Keeping the File Creation Date and Time... - Programmer

This is a discussion on Keeping the File Creation Date and Time... - Programmer ; Greetings, I am using the following function to FTP a file if I find its date and time to be different on the local machine. However, after I FTP it in, I notice that the creation date is the recent ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Keeping the File Creation Date and Time...

  1. Keeping the File Creation Date and Time...

    Greetings,

    I am using the following function to FTP a file if I find its date and
    time to be different on the local machine. However, after I FTP it
    in, I notice that the creation date is the recent transfer date and
    time. Is ther a way to keep the original Creation date and time?

    CopyFile does not change the date and time of the original, however,
    it has to come from a folder where the user needs permission and that
    is not always the case.

    Any assistance would be greatly appreciated.

    ------------------ Code ------------------------------

    if(!FtpGetFile(hOpenUrlHandle,"ServerFile.exe","C:\\ServerFile.exe",FALSE,
    FILE_ATTRIBUTE_NORMAL,FTP_TRANSFER_TYPE_BINARY |
    INTERNET_FLAG_NO_CACHE_WRITE,0))
    {
    sprintf(szMessage, "FtpGetFile IS NOT ACHIEVED\n")
    OutputDebugString(szMessage);
    // return FALSE;
    }
    else
    {
    sprintf(szMessage, "FtpGetFile Transfer Completed\n");
    OutputDebugString(szMessage);
    }

    -------------------- End Code ----------------------------

  2. Re: Keeping the File Creation Date and Time...

    bunny wrote in message news:<3F253845.8050507@eidosnet.co.uk>...
    > Johnny Sandaire wrote:
    > > Greetings,
    > >
    > > I am using the following function to FTP a file if I find its date and
    > > time to be different on the local machine. However, after I FTP it
    > > in, I notice that the creation date is the recent transfer date and
    > > time. Is ther a way to keep the original Creation date and time?
    > >
    > > CopyFile does not change the date and time of the original, however,
    > > it has to come from a folder where the user needs permission and that
    > > is not always the case.
    > >
    > > Any assistance would be greatly appreciated.

    >
    > could you not fetch the creation time of the file on the remote server
    > using FtpFindFirstFile, then download it, then set its creation time
    > using SetFileTime?
    >
    > >
    > > ------------------ Code ------------------------------
    > >
    > > if(!FtpGetFile(hOpenUrlHandle,"ServerFile.exe","C:\\ServerFile.exe",FALSE,
    > > FILE_ATTRIBUTE_NORMAL,FTP_TRANSFER_TYPE_BINARY |
    > > INTERNET_FLAG_NO_CACHE_WRITE,0))
    > > {
    > > sprintf(szMessage, "FtpGetFile IS NOT ACHIEVED\n")
    > > OutputDebugString(szMessage);
    > > // return FALSE;
    > > }
    > > else
    > > {
    > > sprintf(szMessage, "FtpGetFile Transfer Completed\n");
    > > OutputDebugString(szMessage);
    > > }
    > >
    > > -------------------- End Code ----------------------------
    > >



    Correct! That is what I wind up doing. Thanks, JS

+ Reply to Thread