ftp application using socket programming


 
Thread Tools Search this Thread
Top Forums Programming ftp application using socket programming
# 1  
Old 09-23-2005
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
# 2  
Old 09-23-2005
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Ubuntu

Socket Programming

HI Can anyone provide me with codes for file transfer server to client or vice versa? Also please explain how to compile those programs in ubuntu terminal as i am totally new to socket programming. Thanks (1 Reply)
Discussion started by: mayhemtrigger
1 Replies

2. Programming

socket programming

how to include socket.h in visual studio 2005.. (2 Replies)
Discussion started by: asd123
2 Replies

3. UNIX for Dummies Questions & Answers

hi i need help with socket programming

in socket programming how can i : Create for example 3 blank files, namely: server, client, network •Server: act as servers/provider, will receive all requests from different client •Client: requesters •Network: middle-layer of communication between server & client any tips or... (6 Replies)
Discussion started by: kedah160
6 Replies

4. Programming

Help with socket programming in C

hi guys i got this code trying to make connection between the server and multi clients but when i do ./server i got message server waiting then when i run ./client it says client 1 nosuch file i dont know whats that should i use any argument plz help how to compile and run and whats the expected... (1 Reply)
Discussion started by: kedah160
1 Replies

5. UNIX for Dummies Questions & Answers

Socket programming

in c socket programming, how can I send and received on the same port? (7 Replies)
Discussion started by: Peevish
7 Replies

6. UNIX for Advanced & Expert Users

socket programming

can we send udp message to a destination ip address .. without having an ip address configured in our machine using recvfrom ? (2 Replies)
Discussion started by: Gopi Krishna P
2 Replies

7. UNIX for Dummies Questions & Answers

socket programming using udp for chat application

hi, i have a source code for 1 server and 2 clients ...but the clients are not able to send data..1 server only receives data from clients and forwards to any other client, the data is in the buffer.....please help... thank you in advance..... /**********client1***************/ // Here Data... (1 Reply)
Discussion started by: unsweety
1 Replies

8. UNIX for Advanced & Expert Users

socket programming

Hi, I am trying to connect to more than 60 servers to perform some actions remotely. for this I am using ssh2. But its taking lot of time. Though i am running the command in background, still its taking long time to execute.. Any one let me know can we use sockets instead of ssh2 for... (3 Replies)
Discussion started by: pvamsikr
3 Replies

9. Programming

Socket Programming socket

Hello, I actually try to make client-server program. I'm using SCO OpenServer Release 5.0.0 and when I try to compile my code (by TELNET) I've got this error : I'm just using this simple code : and I get the same error if I use : If someone can help me, Thanks (2 Replies)
Discussion started by: soshell
2 Replies

10. Programming

Socket programming

Suppose i am writing a C program which is going to use Socket calls. I want to use a Unix port for my Socket. How can i determine a port which is not already in use? (1 Reply)
Discussion started by: Nadeem Mistry
1 Replies
Login or Register to Ask a Question