The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
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

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 09-23-2005
Registered User
 

Join Date: Sep 2005
Posts: 5
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
Reply With Quote
Forum Sponsor
  #2  
Old 09-23-2005
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,326
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.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:12 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0