Read Write ANSI/C
-
Hello! I have another problem. I want to make 2 programs a client and a server. This programs must access the same file and read/write into it. EXAMPLE: if the client write to the file: #CLIENT 1 REQUEST the server must read this and response: #S CLIENT 1 REPLAY Now this is the problem: I want to do this in client: while (1) { read from file; if string readed containt #S CLIENT 1 { do some action Ex: write to file #RESPONSE ACCEPTED } } and I want that client to do this forever. And I want the same to do the server. Now How do I open/read/write to file? Or how to do this? Only ANSI/C code. Thank You! Bye!
-
Hello! I have another problem. I want to make 2 programs a client and a server. This programs must access the same file and read/write into it. EXAMPLE: if the client write to the file: #CLIENT 1 REQUEST the server must read this and response: #S CLIENT 1 REPLAY Now this is the problem: I want to do this in client: while (1) { read from file; if string readed containt #S CLIENT 1 { do some action Ex: write to file #RESPONSE ACCEPTED } } and I want that client to do this forever. And I want the same to do the server. Now How do I open/read/write to file? Or how to do this? Only ANSI/C code. Thank You! Bye!