Opened 4 years ago

Closed 3 years ago

#54 closed defect (fixed)

Specifying touch.exe instead of touch should not use the internal touch

Reported by: Andreas Schnellbacher Owned by: Gregg Young
Priority: minor Milestone: Version-3.10
Component: Commands Version: 3.08
Keywords: Cc:

Description

In order to make compiling Christian's apps work with the touch option for release versions, touch.exe has to be used. Executing the internal touch command of 4os2 is not compatible.

Many years ago, my workaround was to append '.exe' to the 'touch' call. Christian and Andi (hi!) applied that, too.

I haven't tried it since then again. On compiling the DOSBox .wpi, Jochen told me that he had problems. I searched and found out that he uses a recent 4os2. Needless to say that making the release worked with CMD.

The current workaround would be to use the full path %UNIXROOT%\usr\bin\touch.exe.

But from my POV, that's a bug. 4os2 should better search for an .exe file in PATH, if '.exe' was specified. Again: That worked in an older version.

This is version 3.08.3-shl, as distributed with ArcaOS 5.0.1, I think.

Change History (4)

comment:1 Changed 4 years ago by Andreas Schnellbacher

Testcases

touch --help
touch.exe --help
G:\usr\bin\touch.exe --help

Additionally with forward slashes, from curiosity:

G:/usr/bin/touch.exe --help

Testcases with output

{0}[c:\] set lang=en_US

{0}[c:\] ver

4OS2  3.08.3-shl     OS/2 Version is 4.50

{0}[c:\] touch --help
SYS0002: The system cannot find the file specified. "C:\--help"

{0}[c:\] touch.exe --help
SYS0002: The system cannot find the file specified. "C:\.exe"
SYS0002: The system cannot find the file specified. "C:\--help"

{0}[c:\] G:\usr\bin\touch.exe --help
Usage: G:\usr\bin\touch.exe [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: <https://www.gnu.org/software/coreutils/>
Full documentation <https://www.gnu.org/software/coreutils/touch>
or available locally via: info '(coreutils) touch invocation'

{0}[c:\]  G:/usr/bin/touch.exe --help
Unknown command "G:"

{2}[c:\]

comment:2 Changed 4 years ago by Andreas Schnellbacher

Another workaround found: Enquote the name. Even the extension isn't required then. That's much simpler than searching for the full filename before calling it.

{0}[c:\] "touch" --help
Usage: G:\USR\BIN\touch.exe [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: <https://www.gnu.org/software/coreutils/>
Full documentation <https://www.gnu.org/software/coreutils/touch>
or available locally via: info '(coreutils) touch invocation'

{0}[c:\]

comment:3 Changed 3 years ago by Gregg Young

Owner: set to Gregg Young
Status: newaccepted

This problem extends to all internal commands

comment:4 Changed 3 years ago by Gregg Young

Resolution: fixed
Status: acceptedclosed

Rev 38304, 38299

Note: See TracTickets for help on using tickets.