Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 61a8cca17abf9acafc63b5d94fd7272b946b93dd
Ticket: 971976ffffffffffffffffffffffffffffffffff
Inconsistent naming in [file exists]
User & Date: coldstore on 2004-07-05 20:26:46
Changes

  1. icomment:
    Logged In: YES 
    user_id=19214
    
    A hopefully clarifying statement: '/' is a path element
    separator, not a path element terminator.
    
    It follows, then, that a path x/ is a path which consists of
    x followed by nothing.  If x is a directory, then x/ exists.
     If x is a file, then x/ can't exist, nor can x/. or any
    other similar path.
    
    (i) What does 'file normalize wikit.vfs' do when the file
    doesn't exist but the directory does?  Is a '/' added?
    Remember that the definition of a normalized path is the
    _unique_ representation.
    
    I don't think it would add a trailing '/', the unique
    representation is presumably .../wikit.vfs.  wikit.vfs/ is
    an alias for the file's name iff it is a directory.
    
    (ii) What does it do when (with a vfs) in some sense both exist?
    
    That's an interesting question.  I suggest that the
    difference between a vfs directory which is also a file is
    purely that it can be [open]ed and read, written, etc.  Does
    the 'file/dir' fred/ exist?  Yes, if there is a directory,
    because fred/ fred// fred/../fred fred/. are all synonyms, I
    think.
    
    (iii) What does 'file normalize wiki.vfs//////' do with your
    patch?
    
    Seems to reduce it to wiki.vfs, which seems right.
    
    (iv) The patch needs to add lots of tests for the new behaviour:
    
    glob -dir foo/ *
    glob -path foo/ *
    file isdir foo
    file isdir foo/
    etc.
    
    (v) What does 'file isdir foo' return, when the directory
    'foo/' exists?
    
    The directory 'foo/' or the directory 'foo\/' ?
    
    (vi) What does 'file dirname foo/bar' return?  Just 'foo' or
    'foo/'?
    
    It should return 'foo', as it does now, IMO.
    
    
    
  2. login: "coldstore"
  3. mimetype: "text/plain"
  4. username: "coldstore"