TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: David Bethel on August 14, 2017, 09:19:48 AM
-
Good morning,
Has anyone successfully used DosLIBs dos_touch ?
I thousands of files to change the file date only to a new value. I'm not finding much as far as as details
TIA -David
-
Well it looks like dos_touch only sets the time / date to the current settings.
I'll search some more Thanks! -David
-
What are you looking to do? Would a date field do the trick?
-
I am trying to edit the date on a lot of index.htm files to a date that is stored within the file ( it's true creation date )
Over the years I've done global editing on a lot of the these files and each time the file date is changed to the date of the edit. Maybe 4,000 out of 8,500 have this problem.
I was hoping dos_lib could do the trick. Maybe I can find an old Norton utitlity ( all files names are 8.3 format )
-David
-
Total Commander (http://www.ghisler.com/) can do this.
-
Thanks! I'll try it !
-
There is a touch utility here .... http://gnuwin32.sourceforge.net/packages/coreutils.htm
-
That looks powerful as well !
-
Mark, I don't think touch (gnu) alone will do what the OP wants. You'd have to use grep or find along with touch I imagine.
touch --help
Usage: touch [OPTION]... FILE...
Update the access and modification times of each FILE to the current time.
A FILE argument that does not exist is created empty, unless -c or -h
is supplied.
A FILE argument string of - is handled specially and causes touch to
change the times of the file associated with standard output.
Mandatory arguments to long options are mandatory for short options too.
-a change only the access time
-c, --no-create do not create any files
-d, --date=STRING parse STRING and use it instead of current time
-f (ignored)
-h, --no-dereference affect each symbolic link instead of any referenced
file (useful only on systems that can change the
timestamps of a symlink)
-m change only the modification time
-r, --reference=FILE use this file's times instead of current time
-t STAMP use [[CC]YY]MMDDhhmm[.ss] instead of current time
--time=WORD change the specified time:
WORD is access, atime, or use: equivalent to -a
WORD is modify or mtime: equivalent to -m
--help display this help and exit
--version output version information and exit
Note that the -d and -t options accept different time-date formats.
GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
Report touch translation bugs to <http://translationproject.org/team/>
Full documentation at: <http://www.gnu.org/software/coreutils/touch>
or available locally via: info '(coreutils) touch invocation'
-
I found 1 that is pretty straight forward nircmd
in a batch file
c:\download\nircmd.exe setfiletime "z:\web\zoiba\index.htm" "10-05-2008 01:34:22" "30-03-2001 01:34:22"
A little picky on the exact format
- no backslashes
- "-" delimiter in dates
- ":" delimiter in time
1,785 calls in a single bat file for 1 client. No crashes
So far so good. thanks -David
-
I don't remember i detail, but dos_touch works if you read all the informations in detail. And I think you have consider this information too:
https://wiki.mcneel.com/doslib/dos_strformatdate
-
Thanks, My version of DosLIB is very old. Apparently the function has been updated over the year. Mine will only accept 1 parameter ( the file name )
-David