Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 257d449d4301257ca6702fb138904d143436d493b795a2cb1df9ac06cd28236a
Ticket: 61f4c677709c542a83abe089b3822e165c45cd09
The info command doesn't care of the working directory if changed by the program
User & Date: geballin on 2023-06-20 16:02:22
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-markdown"
  4. comment changed to:
    This is a bug in the info command.
    The info command doesn't care of the working directory when changed by the program using a simple cd.
    This give a bug when used in conjonction with file normalize.
    
    Exemple with this code, run from everywhere using relative file path for launching the script tclsh or source it, it should always find himself which doesn't work :
    
        cd [file dirname [file normalize [info script]]]
        set myselfPath [file normalize [info script]]
        puts $myselfPath
        if {[file exist $myselfPath]} {
          puts "I found myself"
        } else {
          puts "I can't find the file $myselfPath which should be myself"
          exit 1
        }
    
    A simple way to avoid that kind of bugs will be to have [info script] always return absolute path, even if source or Tcl_EvalFile launched with a relative filename as argument.
    
  5. foundin changed to: "8.6.13"
  6. is_private changed to: "0"
  7. login: "geballin"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "6dcd7ca00fdbf25f6645f6a67a11668e7b5ef099"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "geballin"
  14. subsystem changed to: "17. Commands I-L"
  15. title changed to:
    The info command doesn't care of the working directory if changed by the program
    
  16. type changed to: "Bug"