Like Tree4Likes

file Sync

This is a discussion on file Sync within the Networking/Device Communication forums, part of the General Programming Boards category; Hello ! Can you please help me to do this program : get the last modified time of a file ...

  1. #1
    Registered User
    Join Date
    May 2012
    Posts
    8

    file Sync

    Hello !

    Can you please help me to do this program :

    get the last modified time of a file on clientA
    send a sync_message request to the serverA containing the filename, last modified time.
    read a sync_message response from the server containing filename, the server's last modified time for the file on the server.

    if the last modified time in the message from the serverA is more recent that the local last modified time

    • the clientA will read the file from the server one CHUNKSIZE chunk at a time and will replace the local file with the contents from the serverA.
    • otherwise, the client will send the local file one CHUNKSIZE chunk at a time and will replace the file in the serverA by the client file.


    Thank you in advance

    Best Regards,
    Melissa.

  2. #2
    Registered User
    Join Date
    Dec 2011
    Posts
    795
    What part are you having trouble with?

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,852
    Interesting....
    Assignment 4: Dropbox
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    Registered User
    Join Date
    May 2012
    Posts
    8
    First Thank you for your answers

    @memcpy : I need a code can connect clientA to a serverA and get modified time of a file (/share/file1.txt) located in serverA, and compare it with modified time of file1 (/share/file1) located in the clientA,
    if client_F_M_Time is newer than the server_F_M_Time -> the program replace the file in the server by the new one (client file)
    else if server_F_M_Time is newer than the client_F_M_Time -> the program replace the file in client with de new one (server file).

    @Salem : i have already see this link, but that is not what i'm looking for, my program is not complicated like that

    Thanks.

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,852
    > I need a code can ... pretty much the whole frikin assignment....
    Here, read this -> Announcements - Networking/Device Communication

    Then post some actual effort (say you can read all the filenames in the current directory, and are then stuck).

    But if you're just looking for a free ride through college by getting others to do your work for you, then you're in the wrong place.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  6. #6
    Registered User
    Join Date
    May 2012
    Posts
    8
    i've did some code to read the modified time and copie file in local but i don't know how to do that for remote file in another server

    i will not use directory in my program is juste one file shared
    @Salem : can you help me please ?
    Last edited by Island; 05-21-2012 at 06:43 AM.

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,852
    Well the next step is to read beej -> Beej's Guide to Network Programming
    Compile and play around with the example client/server.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  8. #8
    Registered User
    Join Date
    May 2012
    Posts
    8
    Can you send me a code to connect clientA to serverA ?

  9. #9
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,852
    No - go away.
    We're not here to spoon-feed you answers on demand.

    Show some effort, like reading the link for a day or two, then come back with some actual question indicating what you tried and where you're stuck.

    Bouncing back with a "gimmetehcodez" in 10 minutes means you're just not interested in making an effort, and therefore not worth our time in helping you.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  10. #10
    Registered User
    Join Date
    May 2012
    Posts
    8
    Ok if you can't, stop answering me

    some one can help me please ?

  11. #11
    Registered User
    Join Date
    May 2010
    Posts
    2,919
    some one can help me please ?
    Not likely. You need to show some actual effort.

    Jim

  12. #12
    Registered User
    Join Date
    May 2012
    Posts
    8
    ok i will work on it and return to you

  13. #13
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,657
    i've did some code to read the modified time and copie file in local but i don't know how to do that for remote file in another server

    i will not use directory in my program is juste one file shared
    Someone needs to send the instructor an email with a link to this thread. She's trying to at least get partial credit according to the marking scheme:

    Synchronize messages (20%)
    - Client sends the sync_messages to the server
    - The server compares the times and sends the sync_message back
    - Partial credit if this works for at least one file
    I'll quote the OP so it can't be deleted.

    Hello !

    Can you please help me to do this program :

    get the last modified time of a file on clientA
    send a sync_message request to the serverA containing the filename, last modified time.
    read a sync_message response from the server containing filename, the server's last modified time for the file on the server.

    if the last modified time in the message from the serverA is more recent that the local last modified time

    the clientA will read the file from the server one CHUNKSIZE chunk at a time and will replace the local file with the contents from the serverA.
    otherwise, the client will send the local file one CHUNKSIZE chunk at a time and will replace the file in the serverA by the client file.



    Thank you in advance

    Best Regards,
    Melissa.

    First Thank you for your answers

    @memcpy : I need a code can connect clientA to a serverA and get modified time of a file (/share/file1.txt) located in serverA, and compare it with modified time of file1 (/share/file1) located in the clientA,
    if client_F_M_Time is newer than the server_F_M_Time -> the program replace the file in the server by the new one (client file)
    else if server_F_M_Time is newer than the client_F_M_Time -> the program replace the file in client with de new one (server file).
    i've did some code to read the modified time and copie file in local but i don't know how to do that for remote file in another server

    i will not use directory in my program is juste one file shared
    Can you send me a code to connect clientA to serverA ?
    Ok if you can't, stop answering me

    some one can help me please ?
    memcpy likes this.

  14. #14
    Registered User
    Join Date
    May 2012
    Posts
    8
    i'm not a student, i work as unix administrator

  15. #15
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,852
    Oh, in which case, perhaps you should have said so at the beginning.

    Try this, it's all you need already done.
    rsync(1) - Linux man page


    Rather than copy/pasting the text for some homework assignment, which basically makes it look like - you know, homework.
    rags_to_riches likes this.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Cloud sync and P2P sync
    By Mario F. in forum Tech Board
    Replies: 1
    Last Post: 07-01-2010, 04:38 PM
  2. possible reasons wstring is out of sync with _Bx?
    By bling in forum C++ Programming
    Replies: 2
    Last Post: 09-20-2008, 02:30 PM
  3. How to keep local and remote DB in sync
    By nicksnels in forum Tech Board
    Replies: 0
    Last Post: 09-10-2007, 03:17 AM
  4. Sync. objects
    By Hunter2 in forum Windows Programming
    Replies: 2
    Last Post: 03-13-2004, 05:20 PM
  5. running firewalls in sync
    By iain in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 12-23-2001, 11:26 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21