Tcl Source Code

View Ticket
Login
Ticket UUID: 29b19f5ef0ccab7cbe8debabd5c9b246ae4cd444
Title: Inconsistencies in zipfs path separator on Windows
Type: Bug Created on: 2023-09-14 16:44:35
Submitter: apnadkarni Assigned to: nobody
Subsystem: - New Builtin Commands Severity: Minor
Priority: 5 Medium Last modified: 2023-09-14 16:44:35
Status: Open Closed by: nobody
Resolution: None Closed on:
Version: 8.7
Description:

It is not clear whether paths within zipfs mounts can use backslashes as the path separator on Windows. Examples:

% file exists //zipfs:/mt/testdir/test2
1
% file exists //zipfs:/mt\\testdir\\test2
0
% file exists //zipfs:\\mt\\testdir\\test2
1
% file exists //zipfs:\\mt/testdir/test2
1

It appears backslashes are allowed only if the first path separator after the prefix is a backslash. This is not consistent with other Tcl commands on Windows where backslashes are separators everywhere. Alternatively, if zipfs is to be treated as a different file system where only / is a separator, that would be ok too in my mind as long as that is enforced for the first separator as well.

On a related and somewhat contradictory note, the zipfs code treats paths beginning with \ as UNC paths but not paths beginning with //.