You shouldn't have to worry about the 2nd part of your questions as this is, indeed, handled by TCP/IP.
The first part could be done a number of ways depending on your server configuration. One way is to use HTTP to read the file and FTP to write the file which would involve sockets. You could also set up NFS on the server, export the relevant file systems and then mount them on the client which would be simpler and would only involve basic file i/o.
You don't mention what platform the client program will run on. If it's a flavor of UNIX, check out UNIX Network Programming by W. Richard Stevens for good explanations and examples of sockets programming.
Barring that, do a web search for "sockets," "network programming," and/or "winsock programming" (if you're writing it for Windows).
My question is:
Is there a function in C, that can read the date(last modified, Last accessed, and last accessed) and length of a file.
I know length is easy, point the pointer to the end of the file and the return value is the length. But is there a function to realize this?
Yes, I find the answer, Setsockopt can ONLY be used before bind, If after bind, the socket will not release the port after close.
I met a new problem here: when I compile the program, I find
the following error. What does it mean?
Undefined first referenced
symbol in file
gethostbyname /var/tmp/ccV065JB.o (symbol belongs to impl
icit dependency /usr/lib/libnsl.so.1)
inet_ntoa /var/tmp/ccV065JB.o (symbol belongs to impl
icit dependency /usr/lib/libnsl.so.1)
ld: fatal: Symbol referencing errors. No output written to se
collect2: ld returned 1 exit status
I have included all the .h files I believe is necessary.
What is the possibility of this problem.
Thanks
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.