Jump to content

FileSetTime, FileGetTime and MilliSeconds


Recommended Posts

Hi !

I can't manage milliseconds with FileSetTime and FileGetTime (RoboCopy use it for comparing files).

I think it's specific to NTFS. Anyone know a simple way to do it ?

Thanks

You can rip the _Time_GetFileTime and _Time_SetFileTime functions from Auto3Lib. They handle milliseconds. Check the Auto3Lib help file for examples on usage.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

You can rip the _Time_GetFileTime and _Time_SetFileTime functions from Auto3Lib. They handle milliseconds. Check the Auto3Lib help file for examples on usage.

Perfect ! Waow, great job your "Auto3Lib", next time I start by looking on it !

I was trying to match the time / date of two files, $hFileSrce and $hFileDest.

CODE

$aTime = _Time_GetFileTime($hFileSrce)

$pCreateTime = DllStructGetPtr($aTime[0])

$pLastAccess = DllStructGetPtr($aTime[1])

$pLastWrite = DllStructGetPtr($aTime[2])

_Time_SetFileTime($hFileDest, $pCreateTime, $pLastAccess, $pLastWrite)

Thank's a lot ! :)
Link to comment
Share on other sites

Perfect ! Waow, great job your "Auto3Lib", next time I start by looking on it !

I was trying to match the time / date of two files, $hFileSrce and $hFileDest.

CODE

$aTime = _Time_GetFileTime($hFileSrce)

$pCreateTime = DllStructGetPtr($aTime[0])

$pLastAccess = DllStructGetPtr($aTime[1])

$pLastWrite = DllStructGetPtr($aTime[2])

_Time_SetFileTime($hFileDest, $pCreateTime, $pLastAccess, $pLastWrite)

Thank's a lot ! :)
You're welcome. :)
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

  • 9 years later...
  • Moderators

@ScottSaltz any explanation on why you resurrected a 7 year old thread, just to quote what someone else already said?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...