1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

C: vs. C:\ (OT)

Discussion in 'Support' started by vefatica, Jun 22, 2013.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,883
    Likes Received:
    29
    The notion of the current directory on a drive other than the drive containing my current directory hasn't meant anything to me in over twenty years. In fact I haven't even thought about it in that long.

    I recently noticed (the hard way) that at least some C and Win32 functions still respect the difference between C: and C:\ (e.g., _wfullpath and GetFullPathName).

    I was surprised to see (but understand):
    Code:
    v:\> echo %@truename[g:]
    G:\TC15
     
    v:\> echo %@truename[g:\]
    G:\
    I can't imagine capitalizing on that. Does anyone use this distinction to advantage?
     
  2. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    Most certainly I do many times a day! When you have multiple disk volumes (whether on a single system, or mapped through the LAN) containing identical directory trees / subtrees, updating (backup) is simplest if %@cwd[s:] and %@cwd[t:] match (i.e., each points to the root of the matching subtree of its respective drive), so you can just copy /s /uf s: t:.

    BTW, the distinction dates back at least to PC-DOS 3. It is associated with the table PC-DOS maintained for all 26 drive letters of its current default directory, dropped in some old version of Windows, but which the JPsoft command processors do maintain. Thanks, Rex! Without such a table you'd have to spell out the two paths in full for copy etc.

    The availability of the distinction in some Windows API-s makes it simpler to implement the distinction in a command processor.
     
  3. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    0
    And I also do what Steve does on a regular basis. I would really hate for this capability/distinction to be taken away. Minor point: the directory trees from the root of the drive (X:\) may not be identical, but the trees are identical starting at the current directory on each drive and working on down.
     
  4. thedave

    Joined:
    Nov 13, 2008
    Messages:
    254
    Likes Received:
    2
    It's also worth noting that Windows 8's CMD.EXE maintains this distinction.
     
  5. David Marcus

    Joined:
    Jun 4, 2008
    Messages:
    646
    Likes Received:
    1
    I vaguely recall that in Windows 98, it was global. So, if you had two copies of 4dos running and one changed the current directory on a drive, it would change for the other one. Rather dangerous.
     
  6. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    I have no recollection of such malfeasance. It would affect not only 4DOS instances, but all programs. Say you are doing a wildcard move in one window, with implied specification of the source or target directory (using the table of current defaults for each drive) and another program changes one of them - your process would use the wrong source files or destination - you'd end with a real mixed up file system. However, the OS had its own copy of the table, and when a program was started, it inherited the current settings. And yes, there was an equivalent of today's SET /S: SET /M, but already running programs were not affected.
     

Share This Page