Thread: file time changing help

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    731

    file time changing help

    Well now I need to change the file time on a file.

    I got this code from msdn...

    Code:
    SetFileTime(
      HANDLE hFile,
      const FILETIME* lpCreationTime,
      const FILETIME* lpLastAccessTime,
      const FILETIME* lpLastWriteTime
    );
    Thats not hard to understand.

    but this is what I forgot how to do...

    Code:
    typedef struct _FILETIME {  DWORD dwLowDateTime;  DWORD dwHighDateTime;
    } FILETIME, *PFILETIME;
    Please help me.

  2. #2
    Registered User
    Join Date
    Aug 2003
    Posts
    1,218
    Check this out and also follow the links. you should be able to find out how it works quite fast.

  3. #3
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    I'v been looking and reading that, but I am just not getting this.

  4. #4
    Registered User
    Join Date
    Aug 2003
    Posts
    1,218
    Have you also checked to see what the SYSTEMTIME struct contains?? It really isnt hard with this function at all, just remember that LPFILETIME really is FILETIME*

  5. #5
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    I got this code now, it doesn't do anything but I get an error with it still.

    SetFileTime("test.txt",NULL,NULL,NULL);

    The error is

    9 C:\Documents and Settings\Alex\Desktop\File Time.cpp invalid conversion from `const void*' to `void*'

  6. #6
    Registered User jlou's Avatar
    Join Date
    Jul 2003
    Posts
    1,090
    Code:
    SetFileTime(
      HANDLE hFile,
      const FILETIME* lpCreationTime,
      const FILETIME* lpLastAccessTime,
      const FILETIME* lpLastWriteTime
    );
    "test.txt" is not a HANDLE.

  7. #7
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    told you I forgot alot about c++, so...

    how would I go bout this?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newbie homework help
    By fossage in forum C Programming
    Replies: 3
    Last Post: 04-30-2009, 04:27 PM
  2. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 04:54 PM
  3. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. file & linked list run time error
    By Micko in forum C Programming
    Replies: 9
    Last Post: 03-06-2004, 02:58 AM