![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Socket communication and timer application | tryit | Linux | 0 | 06-07-2008 02:58 AM |
| socket communication and timer application | tryit | UNIX for Dummies Questions & Answers | 0 | 06-06-2008 01:35 PM |
| segmentation fault in socket application | amitpansuria | Linux | 8 | 04-18-2008 12:18 AM |
| Which application has a TCP socket open | murphyboy | UNIX for Dummies Questions & Answers | 3 | 10-26-2005 02:29 AM |
| Socket Programming socket | soshell | High Level Programming | 2 | 06-29-2004 04:49 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
ftp application using socket programming
i have made a ftp application in socket programming which uses TCP/IP .. i have the problem runing the only problem is on the client side i take the user input for the file to be downloaded from the command promt.
write(s, argv[2], strlen(argv[2])+1); // this is how i write in client side argv[2] is reading the file name read(sa, buf, BUF_SIZE);// how i read in server side sa is the variable for newsockfd the only from problem is if the user requests for a file which does not exist .. how to put a error condition for it and how to chck it.. i |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
You can just try to open the file in any case. Suppose you are using the open system call, then opening a file that does not exist will return -1 and the errno variable will be set with "ENOENT". When this happens, you can return an error to the client saying that the file does not exist.
|
||||
| Google The UNIX and Linux Forums |