Author Topic: dos_touch  (Read 1942 times)

0 Members and 1 Guest are viewing this topic.

David Bethel

  • Swamp Rat
  • Posts: 656
dos_touch
« 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
« Last Edit: August 14, 2017, 09:56:03 AM by David Bethel »
R12 Dos - A2K

David Bethel

  • Swamp Rat
  • Posts: 656
Re: dos_touch
« Reply #1 on: August 14, 2017, 09:55:25 AM »
Well it looks like dos_touch only sets the time / date to the current settings.

I'll search some more  Thanks!  -David
R12 Dos - A2K

tombu

  • Bull Frog
  • Posts: 289
  • ByLayer=>Not0
Re: dos_touch
« Reply #2 on: August 14, 2017, 10:33:21 AM »
What are you looking to do?  Would a date field do the trick?
Tom Beauford P.S.M.
Leon County FL Public Works - Windows 7 64 bit AutoCAD Civil 3D

David Bethel

  • Swamp Rat
  • Posts: 656
Re: dos_touch
« Reply #3 on: August 14, 2017, 10:43:01 AM »
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
R12 Dos - A2K

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: dos_touch
« Reply #4 on: August 14, 2017, 11:16:29 AM »
Total Commander can do this.

David Bethel

  • Swamp Rat
  • Posts: 656
Re: dos_touch
« Reply #5 on: August 14, 2017, 11:37:42 AM »
Thanks!  I'll try it !
R12 Dos - A2K

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Re: dos_touch
« Reply #6 on: August 14, 2017, 11:48:34 AM »
TheSwamp.org  (serving the CAD community since 2003)

David Bethel

  • Swamp Rat
  • Posts: 656
Re: dos_touch
« Reply #7 on: August 14, 2017, 12:08:40 PM »
That looks powerful as well !
R12 Dos - A2K

JohnK

  • Administrator
  • Seagull
  • Posts: 10625
Re: dos_touch
« Reply #8 on: August 14, 2017, 03:29:48 PM »
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
Code: [Select]
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'
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

David Bethel

  • Swamp Rat
  • Posts: 656
Re: dos_touch
« Reply #9 on: August 14, 2017, 04:51:22 PM »
I found 1 that is pretty straight forward  nircmd

in a batch file

Code: [Select]
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
R12 Dos - A2K

Peter2

  • Swamp Rat
  • Posts: 650
Re: dos_touch
« Reply #10 on: August 16, 2017, 01:24:23 PM »
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
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

David Bethel

  • Swamp Rat
  • Posts: 656
Re: dos_touch
« Reply #11 on: August 17, 2017, 06:11:32 AM »
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
R12 Dos - A2K