• inconsistent 'glob' behaviour on windows with long pathnames

    From Ralf Fassel@21:1/5 to All on Tue May 17 15:33:26 2022
    tcl 8.6.12, Windows 10 latest updates applied

    Asking for long filename (which does not exist)
    % glob -nocomplain [string repeat x 251]
    Ok, empty list.

    Adding a "*" makes the glob err out
    instead of returning an empty list:
    % glob -nocomplain [string repeat x 251]*
    couldn't read directory "C:/Users/ralf/AppData/Local/Temp/ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*":
    no such file or directory

    IMHO both commands should return an empty list, even if the second hits
    the MAX_PATH limit in Windows.


    On Linux I can do

    % glob -nocomplain [string repeat x 1000000]
    % glob -nocomplain [string repeat x 1000000]*

    empty list each, no error, although trying to create that file also
    returns an error since the file name is too long.

    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Tue May 17 15:53:31 2022
    Am 17.05.2022 um 15:33 schrieb Ralf Fassel:
    tcl 8.6.12, Windows 10 latest updates applied

    Asking for long filename (which does not exist)
    % glob -nocomplain [string repeat x 251]
    Ok, empty list.

    Adding a "*" makes the glob err out
    instead of returning an empty list:
    % glob -nocomplain [string repeat x 251]*
    couldn't read directory "C:/Users/ralf/AppData/Local/Temp/
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*":
    no such file or directory

    IMHO both commands should return an empty list, even if the second hits
    the MAX_PATH limit in Windows.


    On Linux I can do

    % glob -nocomplain [string repeat x 1000000]
    % glob -nocomplain [string repeat x 1000000]*

    empty list each, no error, although trying to create that file also
    returns an error since the file name is too long.

    R'

    File a bug. In the past, Magic Jan did care.
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ralf Fassel@21:1/5 to All on Tue May 17 19:28:56 2022
    * Harald Oehlmann <wortkarg2@yahoo.de>
    | Am 17.05.2022 um 15:33 schrieb Ralf Fassel:
    | > tcl 8.6.12, Windows 10 latest updates applied
    | >
    | > Asking for long filename (which does not exist)
    | > % glob -nocomplain [string repeat x 251]
    | > Ok, empty list.
    | >
    | > Adding a "*" makes the glob err out
    | > instead of returning an empty list:
    | > % glob -nocomplain [string repeat x 251]*
    | > couldn't read directory "C:/Users/ralf/AppData/Local/Temp/ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*":
    no such file or directory
    | >
    | > IMHO both commands should return an empty list, even if the second hits
    | > the MAX_PATH limit in Windows.
    | >
    --<snip-snip>--

    | File a bug. In the past, Magic Jan did care.
    | Harald

    https://core.tcl-lang.org/tcl/tktview?name=f6db6d1ec4

    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)