Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

read() problem

Status
Not open for further replies.

logic4fun

Programmer
Apr 24, 2003
85
US
Hi All,
I am not sure whether its related to my read call or something else. But i am stuck after the read call in the program.

I am trying to read data from a file (client/server) program. This program works fine when the file name is to a limited size (for eg: PRA2818521119999226AAA.linux1601119999333) but when it tries to read with file name (PRA2818521119999226AAA.linux1601119999333.linux1191119999385) it doesnt work).


All it fails is after my read call. Does read have any limitations of file names.

Here is the call
/*rc=read(fd,(char *)buf+sz,size-sz);*/
or
rc=read(fd,(char *)buf+sz,512); /* i have forced it to 512 */

what it reads is only part of file name such as PRA2818521119999226AAA.linux1601119999333.l and thus at a later stage rest of the program bails out.


Thanks in advance for your help.
 
Why buf+sz? What is it - sz?
In this stage no matter what's a file name - if your file handler is OK...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top