LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

set folder modification date

I have used the OpenG File Info VI to sucessfully read and write file creation and modification dates, but I can't figure out how to set a folder's modification date.

 

To set the date to now, it's simply a metter of writing a temp file to the directory in question, and then deleting it. But If I want to recursively copy a directory to a new location AND preserve the creation or modification timestamps, I can't do it.
 Is there a solution to this problem?

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 1 of 6
(3,320 Views)

You could use .NET to update the CreationTime

 

ChangeFolderTimestamp.png

 

 

 

Message 2 of 6
(3,306 Views)

Wonderful, much appreciated! I wonder why the Open G version doesn't work. Would be nice to have cross-platform, but this works for me for now!

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 3 of 6
(3,296 Views)

I'm also looking to set/modify Folder Creation dates.  How did you place the .NET DirectoryInfo function on your Block Diagram?  I can see the .NET palette under Connectivity, but don't know how to get that first Directory Info function you used.  [I know I can just copy your code, but I want to learn to "do it myself"].  I'm working with LabVIEW 2012 PDS -- is there a special Toolkit that I need to install to see the Directory Info function?

 

Thanks for pointing me (and others) in the Right Direction!

 

Bob Schor

0 Kudos
Message 4 of 6
(3,222 Views)

To find out how to do it I just looked at the supplied code.  The .net constructor points at the DirectoryInfo Object in the mscrolib (4.0.0.0) Assembly.  It's fairly easy to figure out by looking at the code.

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 5 of 6
(3,206 Views)

@kbbersch wrote:

To find out how to do it I just looked at the supplied code.  The .net constructor points at the DirectoryInfo Object in the mscrolib (4.0.0.0) Assembly.  It's fairly easy to figure out by looking at the code.

 


Well, it might have been easy for you to figure out from the "answer" (the DirectoryInfo node), but it was (sadly) harder for me.  However, you did provide a useful hint that leads to the full answer, which I will elaborate here in case any other users who are as clueless as I stumble upon this question.

 

The following are the steps to get the DirectoryInfo node on your Block Diagram (assuming you don't just Copy and Paste from the supplied example.  Note that this is for LabVIEW 2012.

 

  1. Open the Connectivity Palette
  2. Open the .NET Sub-Palette
  3. Choose the Constructor Node (I'd guessed this was the appropriate node because of the "brick" shown in the Example).
  4. You now are faced with a bewildering set of options.  As Kelly pointed out, you want to select the Constructor "mscorlib".
  5. The Constructor has multiple Objects.  Choose System.IO, and expand its "+" sign.
  6. Choose DirectoryInfo.

There.  Wasn't that easy, not to mention intuitive?

 

BS

0 Kudos
Message 6 of 6
(3,148 Views)