#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2013
    Posts
    1
    Rep Power
    0

    C Program To Send Data To Server


    HI, I have an text file I want that file to be sent to server automatically at regular intervals how to write c coding for that?
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,837
    Rep Power
    480
    You don't write c code for that.
    Instead, you write a batch script and work with your operating system's batch scheduler to set up the periodic invocations of your script.
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,145
    Rep Power
    2222
    You could do it in C with a lot of work. Is that what you want to do? Do you already know how to do sockets programming? Do you already know how to program in C?

    How do you send the file now on command? That's what you would want to put into a script.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2013
    Posts
    4
    Rep Power
    0
    I suggest you to use sockets. I don't know about your experience with C, but the program should be pretty simple and straightforward. You will need two separate programs, one acting as a server (the one who will receive the file) and a second one acting as a client (the one who will send the file).
    You can find plenty of examples on internet or books about C programming in Unix/Linux environments. Just search for sockets programming in C.
    Regards.

IMN logo majestic logo threadwatch logo seochat tools logo