Skip to content
Tcl Source Code View Ticket
Login

View Ticket

file join does not work prperly

Closed / Invalid421842ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 25 years ago
Descriptionplain2001-05-06 15:35:40
Bug description : 
file join remove leading slash from the first argument 
if it is computer name only. 
Platform : Windows NT workstation, sp6 
Tcl versions : 8.0p2 and tcl 8.3.2

Example :
% set f1 {\\comp_name}
\\comp_name
% set f2 {dir1\dir2}
dir1\dir2
% file join $f1 $f2
/comp_name/dir1/dir2

It works properly if first argument contains some 
path :
% set f1 {\\comp_name\dir0}
\\comp_name\dir0
% set f2 {dir1\dir2}
dir1\dir2
% file join $f1 $f2
//comp_name/dir0/dir1/dir2
%
andreas_kupriesplain2001-08-23 06:04:02
Logged In: YES 
user_id=75003

Any changes to this due to VFS ?
vincentdarleyplain2001-08-23 23:04:25
Logged In: YES 
user_id=32170

The root of the problem is that:

% file pathtype //foo
volumerelative
% file pathtype //foo/bar
absolute

Is the first of these in error?  If so then we can easily 
fix this bug report.
vincentdarleyplain2001-08-23 23:08:17
Logged In: YES 
user_id=32170

Let me add to my previous comment.

% file pathtype /foo
volumerelative
% file pathtype //foo
volumerelative
% file pathtype /////////////foo
volumerelative

Are some, all or none of these correct?  How does this 
relate to this bug report?
hobbsplain2001-09-04 00:59:51
Logged In: YES 
user_id=72656

The question is, why is this so, and is that fair?  The MSDN
clearly defines UNC thus:

-------------
UNC 
(universal naming convention) A network resource name for a 
share point on a server, consisting of the string

\\<server name>\<share point name> 

As opposed to a resolved drive letter such as S:, a UNC 
name is usable without alteration from any task on any 
computer that has access to the share point. 
-------------

This would mean that when they chose to implement this
in Tcl, they went with the strict view that you have to 
have the name and share point together.  In reality, this 
is the case on Windows.  You can't just have a unc name 
that is just the host - a share must be specified.

My $.02 is that this is a doc bug, not a code bug.
vincentdarleyplain2001-09-04 15:44:56
Logged In: YES 
user_id=32170

While the documentation is not great, the above behaviour 
is in fact given in the filename man page.  I have 
clarified the docs (and added a comment in the C source 
where this decision is made), and so this bug is now closed.
Log in (anonymous is fine) to add a comment.