Tcl Source Code

View Ticket
Login
Ticket UUID: 1219176
Title: file mkdir fails on existing directories
Type: Bug Version: obsolete: 8.5a4
Submitter: tngd Created on: 2005-06-12 14:25:10
Subsystem: 37. File System Assigned To: vincentdarley
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2005-06-13 15:32:25
Resolution: Fixed Closed By: vincentdarley
    Closed on: 2005-06-13 08:32:25
Description:
System: WinXP, Tcl/Tk 8.5 CVS (current), Mingw gcc 3.4.2

i get these problems when creating absolute directories:

% file mkdir .                          <-- no error here
% file mkdir c:/
can't create directory "c:/": permission denied
% file mkdir c:/windows
can't create directory "c:/": permission denied
% file mkdir c:/w
can't create directory "c:/": permission denied
% file mkdir /home
can't create directory "/": permission denied

In function TclFileMakeDirsCmd (tclFCmd.c:222) it
checks if the destination target exists, and if it is
not a directory, it will attempt to create it. But, if
it does exist and is a directory it will still call
Tcl_FSCreateDirectory.

patch is attached with proposed fix (which seems
reasonable to me).

I havent tested it on other platforms (no idea if it
has any impact on symlinks since i did not look inside
function Tcl_FSCreateDirectory.
User Comments: vincentdarley added on 2005-06-13 15:32:25:
Logged In: YES 
user_id=32170

Fixed this, and made sure tests pass correctly.  Also added
more comments so code paths are clearer.

tngd added on 2005-06-12 21:25:10:

File Added - 138093: tclFCmd.c.diff

Attachments: