Set date/time attributes?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • kraigyb
    Indigo Rose Customer
    • Jul 2003
    • 55

    Set date/time attributes?

    You can get the file time/date attributes of files, but there's no built-in function to set them. Anyone know of a shell function or dll that could be used to set time and date attributes of files and folders?

    Thanks much,
    craig booth
  • longedge
    Indigo Rose Customer
    • Aug 2003
    • 2498

    #2
    File.SetAttributes action doesn't cover time & date but neither does the DOS attrib command. You could always open and then close a file to change the 'last accessed' property of the file. Perhaps do a file copy then delete and rename to the original name to set the date created (not sure if that would work??).

    Don't know if Attribute Changer which acts as a shell extension would be any good to you.
    Last edited by longedge; 12-11-2007, 01:33 PM.

    Comment

    • kraigyb
      Indigo Rose Customer
      • Jul 2003
      • 55

      #3
      Thanks longedge, but I was looking for a more direct way to modify the file and folder date/times. I've used some of the 3rd party utilities to change the attributes, which is the same functionality I'd like to include in one of my AMS apps.

      After a little research, it looks theres a 'SetFileTime' function in kernel32.dll. I haven't had any luck calling it.

      I also came across the LuaFileSystem library (www.keplerproject.org), which appears to include a function to modify the access and modification times of a file.

      Does anyone have any experience calling kernel32, lfs, or any oher means of changing file attributes?

      Comment

      Working...
      X