LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

is there a fix for SetFileTime for both odd and even seconds?

I need to set the file time with both odd and even seconds. You can only set even 0-58 sec odd sec round down.
0 Kudos
Message 1 of 4
(3,150 Views)
Hi,

This limitation has to do with a limitation by some files systems; FAT systems have a resolution of 2 seconds. So the function was created to comply to most files systems. (more info here)

If you want to access these parameters with a higher resolution by using the function SetFileTime from the Windows SDK; here is the documentation for it.

There are a couple of things to watch for; installing support for the SDK and duplicate functio
n names (liket his case); make sure that you compile the Windows SDK SetFileTime function in a separate file where you only include winbase.h and windows.h; this way you can be sure that you are using Windwos SDK's function and not CVI's function.

I hope this helps.

Regards,
Juan Carlos
N.I.
0 Kudos
Message 2 of 4
(3,150 Views)
Thanks for the information. More than I was hoping for. Somethings are just not simple. Jeff
0 Kudos
Message 3 of 4
(3,150 Views)
Jeff,

You are right, this is a bit confusion for just setting the time in a file. I actually created a document about this for future reference.

KnowledgeBase 39DAKQ8O: Why Does The Function SetFileTime Takes Only an Even Number of Seconds?

Good Luck!

Juan Carlos
N.I.
0 Kudos
Message 4 of 4
(3,150 Views)