Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-04-20
02:03 • Ticket [218397ffff] Incorrect directory separator returned from info command... artifact: 14e01a3645 user: dgp
2000-10-26
08:21 • Closed ticket [218397ffff]. artifact: 3f1690cfc7 user: welch
00:57 • New ticket [218397ffff]. artifact: e9fd0d01bd user: nobody

Incorrect directory separator returned from info command

Closed / Fixed218397ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:57:05
OriginalBugID: 5216 Bug
Version: 8.3
SubmitDate: '2000-04-20'
LastModified: '2000-04-20'
Severity: LOW
Status: Closed
Submitter: techsupp
ChangedBy: hobbs
OS: Windows NT
FixedDate: '2000-10-25'
ClosedDate: '2000-04-20'


Name:
Jay Schmidgall

ReproducibleScript:
#--------- script ----------
puts [ info script ]
puts [ file dirname [ info script ] ]
#---------- end ------------

On a windows nt box, place the above script in some subdirectory, let's say C:\a\b\c\d as a file bug.tcl.

Now, from the root directory, invoke the file:

C:\> tclsh83d C:\a\b\c\d\test.tcl

ObservedBehavior:
In the above case, the output is

C:\a\b\c\d\test.tcl
C:/a/b/c/d

Note the different forward and backward slashes. Of course, invoking the script with the command

C:> tclsh83 C:/a/b/c/d/test.tcl

works okay, but it would be nice if we had consistent results.

DesiredBehavior:
Both commands returning the string with forward slashes.



This is the correct behavior.  [info script] returns the true
value passed in, and [file dirname] will always return a Tcl
normalized name.  You can get a native name with the file
native command if you so choose. 
-- 04/20/2000 hobbs
welch Closed ticket [218397ffff]. [History diff]2000-10-26 08:21:17
dgp Ticket [218397ffff]: 3 changes [History diff]2001-04-20 02:03:27
Log in (anonymous is fine) to add a comment.