LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I change the file creation date through Labview 2012?

Solved!
Go to solution

I want to change the format of the data stored in some text files, but I want the file dates to remain the same.  Currently, my program creates the files with new dates.

0 Kudos
Message 1 of 12
(7,358 Views)
Message 2 of 12
(7,353 Views)

Can't this be done directly from LabView?

In LabWindows there is a Set File Date and Set File Time function that does this.

0 Kudos
Message 3 of 12
(7,350 Views)
Solution
Accepted by topic author hartzde

LabVIEW to my knowledge doesn't have native functions to do this.

 

You can use .NET functions on Windows to get/set the CreationTime, LastWriteTime and LastAccessTime.

 

See attached VI (LabVIEW 8.6)

 

 

Message 4 of 12
(7,316 Views)

Thanks, this helps.

LabVIEW needs a native function.  File Information does the Get, but there needfs to be a Set for every Get or what's the point.

0 Kudos
Message 5 of 12
(7,307 Views)

This is awesome, thanks for posting the .NET example, Philip Brooks!

0 Kudos
Message 6 of 12
(7,150 Views)

Sorry for bringing back old threads.  If for some reason you need this function in an application built for a Windows computer without the .NET framework installed, don't want to call an additional executable or just feel like being a sadist by using the dreaded call library function nodes, then the quick and dirty snippet below might help.  I also wish LabVIEW had this as a native function.Change File Timestamp.png

-Voky

0 Kudos
Message 7 of 12
(6,399 Views)

Can you attach your Snippet as an actual VI?  I was unable to "make it work", and it is a little too small and tiny for me to attempt to recreate it "by hand".  I've actually written a routine to reset folder TimeStamps (which, unlike the File TimeStamps, are not "replicated" when you copy a Folder Tree), but I used the .NET commands.  I'm always interested in learning "other methods" ...

 

Bob Schor

0 Kudos
Message 8 of 12
(6,240 Views)

@Voky wrote:

Sorry for bringing back old threads.  If for some reason you need this function in an application built for a Windows computer without the .NET framework installed, don't want to call an additional executable or just feel like being a sadist by using the dreaded call library function nodes, then the quick and dirty snippet below might help.  I also wish LabVIEW had this as a native function.Change File Timestamp.png

-Voky


I think Bob may have been complaining because this forum does nasty formatting things to pictures, ever since the "upgrade", that render the magic in the snippet powerless.  (In other words, the meta-data is dumped.)  Now you have to upload it as a file in order for it to retain its magical properties.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 9 of 12
(6,229 Views)

Attached is my VI. I've updated it to support folders, my application only needed file timestamps modified.

-Voky

0 Kudos
Message 10 of 12
(6,226 Views)