LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

programmatically change the modified date of a folder

Solved!
Go to solution

Rolf,

 

The contents of any folder copied to a new location would still have Old Date under the Date Modified column, but have a New Date (Current System Data) under the Date Created column. PFA snapshot.

 

Maybe this is the reason Jim wants to change the Modified Dates programmatically.. ?! Smiley Indifferent

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 21 of 27
(1,688 Views)

@parthabe wrote:

Rolf,

 

The contents of any folder copied to a new location would still have Old Date under the Date Modified column, but have a New Date (Current System Data) under the Date Created column. PFA snapshot.

 

Maybe this is the reason Jim wants to change the Modified Dates programmatically.. ?! Smiley Indifferent


That's completely different.  Those are files, correct?  You only get this if you copied it indirectly.  Like for instance, retrieving it from your versioning software with the wrong parameters.

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.
0 Kudos
Message 22 of 27
(1,683 Views)

@billko wrote:

Those are files, correct? 


Yes, they are.

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 23 of 27
(1,681 Views)

Has anyone tired  using Touch through the System Exec.vi?

http://sourceforge.net/projects/touch-win32/files/v1.21/

Description
Windows version of the Linux tools "touch" to change times of files (full program = 5.5KB).

Usage
touch.exe [-hxamcDsvq] [-r ref_file|-t time|-d date_time] -- <file_1> [file_N]
-h : Show this help
-x : Modify creation time
-a : Modify access time
-m : Modify modification time
-c : Do not create file if not found
-r : Use a file or directory as a reference time source
-D : If target doesn't exist, create a directory
-s : Browse sub-directories
-v : Output the result of every file processed
-q : Silent mode, no error is displayed (disable '-v')
-t : Use time [[CC]YY]MMDDhhmm[.SS] instead of today
-d : Use date_time [[YYYY-]MM-DD][Thh:mm[:ss]] instead of today
-- : Finish options, followed by the file list
The options '-r', '-d' and '-t' can not be used simultaneously.
By default, all times will be modified (creation, access and modification).

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 24 of 27
(1,663 Views)

@parthabe wrote:

@billko wrote:

Name your folders with the appropriate date.  i.e., 2014-10-13 13:04:05 (resolution of the time/date is up to you).


Since I follow this convention in almost all my ATE LabVIEW Er jobs till now, this corner case (I mean the copying contents to a diff machine/network) necessity never came across my mind.

 

Maybe, Bill, you should have used the word "Timestamp" instead of "Date", so that it would not have appeared to Jim that you had overlooked the last part of his statement. Smiley Happy


That was a good catch.  "Timestamp" would have been more appropriate.  🙂

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.
0 Kudos
Message 25 of 27
(1,647 Views)

@parthabe wrote:

@billko wrote:

Those are files, correct? 


Yes, they are.


I was completely wrong about the how the Windows OS handles file copies.  It's no wonder you were confused with what I was saying.

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.
0 Kudos
Message 26 of 27
(1,642 Views)

I have a NAS I've been using for backup, storage, archive, etc.  It went "flaky" on me, so I wanted to copy it.  When I do so (using Windows or a "file copier" utility) I get the file dates preserved on the new machine, but the folder dates all have the Date of Copying showing when I look at the copy with Windows Explorer.

 

I'm not trying to subvert anything -- I'd just like to have as close to an "image copy" as possible, preserving file and folder dates.  Given the flakiness of the source hardware, I didn't want to do a "real" image copy, and found that the  "ordinary copy" (which took 2-3 days, mind you) didn't preserve the folder dates.  Hence my desre for a "Set the Folder Date" utility.  I've already written the top-level code that walks through the Source device, picking up the folders and dates, and passes the information on to the Target device -- I just can't get the Set Folder Date bit to work (though there are three LabVIEW methods to do so, perhaps only valid in Windows XP ...).

 

Still exploring, looking for a solution.  Given that the folders already exist (and have meaningful names), changing the names to include a Creation Date/Time is a complete non-starter for me!

 

BS

0 Kudos
Message 27 of 27
(1,623 Views)