Skip to content
Tcl Source Code History Of Ticket 846567ffffffffffffffffffffffffffffffffff
Login

History Of Ticket 846567ffffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 846567ffffffffffffffffffffffffffffffffff

  1. Ticket change [fbb567a667] (rid 92113) by marcomaggi on 2003-11-21 13:13:12:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      On Unix-like systems when creating a symbolic link:
      
           file link -symbolic link target
      
      and  a directory  component  in "link"  does  not exist
      TCL may return the wrong error message. 
      
      
      package require Tcl 8.4
      package require tcltest 2.2
      
      ::tcltest::configure -verbose "start end error"
      
      ::tcltest::test file-link-error-1.1 "wrong error message" {
          -setup {
      set linkName [file join one two]
      set target three
      
      # If we do not create the directory the wrong error
      # message is returned.
      #::tcltest::makeDirectory one
      ::tcltest::makeFile {some data} $target
          }
          -body {
      catch {
                       file link -symbolic $linkName $target
                  } errmsg
      set errmsg
          }
          -result "I don't know what to put here."
          -cleanup {
      ::tcltest::removeFile $target
      ::tcltest::removeDirectory one
          }
      }
      
      On  my Linux  system the  Info documentation  for
      the GNU C Library  reports  that  the   only  "errno"  
      values  set  by "symlink()"  are:  EEXIST,  EROFS,  
      ENOSPC, EIO;  while  the manual  page   for  "symlink()"  
      (which   is  marked  "Linux Programmer's Manual") lists 
      more codes including:
      
         ENOENT            A directory component  in "newpath"
                               does not exist  or is  a dangling
                               symbolic  link, or "oldpath" is the
                               empty string.
      
        It appears  that "symlink()" returns ENOENT to signal 
      the
      error, but "TclpObjLink()" in "tclUnixFile.c" is supposed to
      leave  this code  in "errno"  only  if the  target does  not
      exist,   hence   the  wrong   error   message  returned   
      by
      "Tcl_FileObjCmd()" in "tclCmdAH.c" around line 1010.
      
        Maybe the algorithm should be:
      
        if (true_if_exists(source))
      return error;
        if (false_if_exists(get_parent(source)))
      return error;
        if (false_if_exists(target))
      return error;
        symlink(...);
      
      The  choice  of   making  "TclpObjLink()"  to  signal  error
      conditions  through  "errno"  seems   to  be  the  cause  
      of
      everything.
      
        Aaah...  the beauty  of functions  that can  fail  for one
      reason only... :)
      
      tcl_platform(byteOrder) = littleEndian
      tcl_platform(machine)   = i686
      tcl_platform(os)        = Linux
      tcl_platform(osVersion) = 2.4.22
      tcl_platform(platform)  = unix
      tcl_platform(threaded)  = 1
      tcl_platform(user)      = marco
      tcl_platform(wordSize)  = 4
      
      tcl_patchLevel = 8.4.4
      
      
      
    4. foundin initialized to: "obsolete: 8.4.4"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "marcomaggi"
    9. subsystem initialized to: "16. Commands A-H"
    10. title initialized to: "file link -symbolic wrong error message"
    11. type initialized to: "Bug"
  2. Ticket change [c12b198432] (rid 111279) by dkf on 2003-11-21 22:08:44:

    1. assignee changed to: "vincentdarley"
    2. subsystem changed to: "37. File System"
  3. Ticket change [587f3f5831] (rid 117816) by vincentdarley on 2003-11-21 22:26:33:

    1. closedate changed to: "2003-11-21T15:26:33"
    2. closer changed to: "vincentdarley"
    3. icomment:
      Logged In: YES 
      user_id=32170
      
      This has been fixed in 8.5a0:
      
      2003-11-10  Vince Darley  <[email protected]>
      
      * generic/tclCmdAH.c:
      * tests/fCmd.test: fix to misleading error message in 'file
      link'
      [Bug 836208]
      
      
      
      
      
    4. login: "vincentdarley"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "vincentdarley"