Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 5a1a7830a379fa4fcd9f8a2fe4165eec5bd69ef880146e0913d834695677d978
Ticket: d8f12171564f57c9ed3ca098d9498b9d76dfb3f7
windows dos device paths inconsistencies and missing functionality
User & Date: juliannoble2 on 2024-08-13 08:28:57
Changes

  1. icomment:
    >First of all: The windows path prefixes are \\?\ and \\.\, not //?/ and //./. Communicating with the win32 API, always backslashes should be used. Of cource, Tcl should handle that for you.
    
    Yes - I prefer to use the / even in examples, because whether it's windows or Tcl doing the translating - that aspect 'just works' whereas examples using backslashes tend to have escaping complications.
    
    I don't entirely agree with the characterisation of the . and ? dos device paths as a hack - but I do recognise that they also provide access to namespaces and devices that don't necessarily fit with the concept of filesystems - and I don't pretend to understand all the issues.
    
    There are useful filesystem based paths such as //./Volume{<guid>}/ 
    These allow access to for example removable media without a drive mapping - or for which the drive mapping is undesirable to use as it may change.
    This can be handy for backup related applications for example.
    (see output of mountvol command in cmd or powershell)
    These can represent filesystem paths available on the system - and I had expected Tcl to be able to access them.
    
    Whilst the MAX_PATH issue has been one of the reasons to use this syntax in the past, I think APN is right that this usecase is now less important.
    
    The //?/ is I think also still important for support of not just trailing dots (and trailing spaces) - but also literal glob chars such as '*' or '?'
    
    I suspect extending special handling to guess when to add the //?/ is not ideal (would have to handle aforementioned globs too?) 
    
    
    If it's decided to just remove support - I think that'd be unfortunate, but perhaps could be worked around with the use of extensions like Twapi.
    
    
    If anything - I think volumerelative paths should be a more likely or desirable candidate for removal - as they tend (in my opinion) to be more useful only in an interactive shell - but as Tcl doesn't support the per-volume cwd - there are already bugs in this area when changing drives in Tcl as compared to what happens in cmd.exe or powershell.
    
    Also, perhaps not directly related, but in the area of path handling - 'open c:/test/file:streamb w' creates an extra file using some sort of substitution for the colon instead of accessing an alternate stream in c:/test/file
    I can't see any way to read/write NTFS alternate data streams from tcl without resorting to external executables or extensions(?)
    
    That 'open fileswithstream w' clobbers the alternate datastream isn't ideal either.
    
    At the very least I'd have thought we could use the //?/ syntax to bypass whatever Tcl is doing on such paths and let windows give access to the right stream.
    
  2. login: "juliannoble2"
  3. mimetype: "text/plain"