1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Rep Power

    path Declaration in fopen(...

    Iam trying to write a program to update the copies of a file in different systems on a network. I am able to find the timestamp of the file in my current system using the fstat(...) function.
    But,I do not know how to specify a path to another system in the network. I tried various ways in vain.

    fh = fopen("C:\\GK\\C++\\file.txt","r");

    The above declaration is working fine to locate the file in my system.

    Suppose the path to the other file is

    where 'mil' is the name of the system. how should I declare it.

    Also,is there any function to compare two time's and find the latest time.
    Please let me know

  2. #2
  3. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Somewhere in the great unknown
    Rep Power
    typically the other systems must be mapped drives, or at least the remote system must have shared rights to the folder that you are trying to access.
    If you do with the system name instead of a mapped drive, remember that every backslash needs to be escaped.

    As far as comparing two times, easiest way that comes to mind is to convert them into strings (if needed) and use strcmp and see what the result is.
    strcmp() gives one of three values depending on how the comparison goes.
    0 = the are equal
    positive # = (can't remember right off hand) left is greater than right
    negative # = right is greater that left

    I would suggest you play around a bit and see, but there may also be a better method for this also.

IMN logo majestic logo threadwatch logo seochat tools logo