Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-08-24
23:38 • Closed ticket [454597ffff]: Limited path size plus 7 other changes artifact: 7c60715930 user: vincentdarley
04:56 • Ticket [454597ffff]: 4 changes artifact: f3762e34dd user: kofeinik
01:40 • Ticket [454597ffff]: 4 changes artifact: 3e9f0a5a55 user: hobbs
2001-08-23
22:14 • Ticket [454597ffff]: 4 changes artifact: a1101ba6a5 user: dgp
22:13 • Add attachment pathlength.tcl to ticket [454597ffff] artifact: 7725185eda user: vincentdarley
22:13 • Ticket [454597ffff] Limited path size status still Open with 4 other changes artifact: 96ca4bb81c user: vincentdarley
14:47 • New ticket [454597ffff]. artifact: 5dd35a586e user: kofeinik

Limited path size

Closed / Wont Fix454597ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 25 years ago
Descriptionplain2001-08-23 14:47:03
Maybe this isn't bug, but annoying feature - 
under Windows path size for all file operations 
limited to about 250 characters, as result, i can't 
work with files, placed in deep directory trees, with 
path longer than 250 characters.
Of course, on pure WinAPI (C/C++) i can work with long 
paths without any problems.
vincentdarleyplain2001-08-23 22:13:31
File Added - 9895: pathlength.tcl

Logged In: YES 
user_id=32170

It would have been helpful to have a more precise example 
of the problem, but fortunately it is easyish to 
reproduce.  The attached script can show at least one bug 
of this type.  It eventually fails with:

can't create 
directory "C:/Apps/dir0.8519/dir0.9923/dir0.1220/dir0.6213/d
ir0.5330/dir0.0420/dir0.7874/dir0.5259/dir0.3268/dir0.1379/d
ir0.6095/dir0.3286/dir0.3591/dir0.5962/dir0.7668/dir0.2869/d
ir0.2434/dir0.3738/dir0.8613/dir0.4409/dir0.5180/dir0.5485/d
ir0.6886/dir0.4262/dir0.1771": file name too long
% 

Since you seem to know something of the Win32 API's 
involved here, Sergey, perhaps you can look at the APIs 
used (they are in tclWin32dll.c, where either some ascii or 
unicode api's are loaded into a lookup table, from which 
they are then called in, say, tclWinFCmd.c or tclWinFile.c) 
and suggest what is wrong with them.  I don't believe Tcl 
itself has any filename length limitations, so I think the 
problem could be we are using older Win32 APIs which have 
such limitations.
dgpplain2001-08-23 22:14:03
Logged In: YES 
user_id=80530

I think an example of some Tcl code
failing to do what you expect would
help clarify this report, and help
locate what code needs changing.

Also, what specific Windows platform
are we talking about?
hobbsplain2001-08-24 01:40:40
Logged In: YES 
user_id=72656

Thas to be related in some way to an internal 260 (seems 
like 260 to me) char limit.  On Win2K, you can try this:

for { set i 100 } { $i < 500 } { incr i } {
set str [string replace [string repeat a $i] end-3 end $i]
  if {[catch {close [open $str w]}]} {
    puts "stopped at $i, allowed \
      [expr {[string length [pwd]]+$i-1}] chars total"
    break
  }
}

For me that returns:
    stopped at 244, allowed 259 chars total

(you have to allow for [pwd] size).  I then went into 
explorer to see if I could edit the file name to be longer -
 I couldn't!  I could remove and add a char, but it 
wouldn't let me go longer.  That indicates a system limit.
kofeinikplain2001-08-24 04:56:26
Logged In: YES 
user_id=286083

Really, under windows there are problems with names of 
files in length close to boundary 260 characters. I rewrite 
the test, also have broken off - as was fairly remarked, 
these problems actually arises at a winapi level. All of an 
apology for early bugreport, though I have written 
about "maybe". :)
vincentdarleyplain2001-08-24 23:38:46
Logged In: YES 
user_id=32170

Unless or until new Win32 api's are available/used this bug 
can't be fixed.

I'll add note to this fact to filename.n, and will close 
the bug (p.s. I don't see a 'maybe' in "Of course, on pure 
WinAPI (C/C++) i can work with long paths without any 
problems").
Log in (anonymous is fine) to add a comment.

Attachments: