Jump to content

Change the Modified Date and Time of a file


Recommended Posts

I need to change the modified Date and Time of a file.

I think that the attached code is going in the right direction. I am trying to do this by making a call to kernal32.dll.

The problem I have is formating the data type to pass to the dll for the Date/Time.

Any help would be great.

Roger

post-1486-1150639004.gif?width=400

Link to comment
  • 2 weeks later...
I need to change the modified Date and Time of a file.

I think that the attached code is going in the right direction. I am trying to do this by making a call to kernal32.dll.

The problem I have is formating the data type to pass to the dll for the Date/Time.

Any help would be great.

Roger

There is a VI File Info.vi in the OpenG Toolkit file package that allows to change the modification date and creation date of a file provided the current user has enough privileges for the file in question.

The prototype you are showing in your VI is VisualBasic syntax and not very helpful for LabVIEW purposes. LabVIEW is strictly typed just as C is and needs to be configured to match the expected C types exactly. If I remember right then FILETIME is a 64bit integer or a long long. This can be achieved directly in LabVIEW 8 with the (u)int64 but in LabVIEW before 8.0 you would have to create a cluster of two (u)int32 and pass that instead.

Rolf Kalbermatter

Link to comment
There is a VI File Info.vi in the OpenG Toolkit file package that allows to change the modification date and creation date of a file provided the current user has enough privileges for the file in question.

The prototype you are showing in your VI is VisualBasic syntax and not very helpful for LabVIEW purposes. LabVIEW is strictly typed just as C is and needs to be configured to match the expected C types exactly. If I remember right then FILETIME is a 64bit integer or a long long. This can be achieved directly in LabVIEW 8 with the (u)int64 but in LabVIEW before 8.0 you would have to create a cluster of two (u)int32 and pass that instead.

Rolf Kalbermatter

Thanks I found it in OpenG yesterday, I should have checked sooner. Yes I was just getting to the cluster of two (u)int32 when I found the VI on OpenG.

Thanks again to You and Openg...

Roger

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.