Skip to content
Tcl Source Code View Ticket
Login

View Ticket

file writable lies for certain XP directories

Closed / Fixed1344540fffffffffffffffffffffffffffffffffCreated 21 years agoUpdated 21 years ago
Descriptionplain2005-11-01 05:21:57
[Duplicate BUG 1193497 -- to allow file attachment]

file writable lies for certain XP directories  
Windows XP SP2 french, Tcl/Tk cvs HEAD

file writable "C:/Documents and 
Settings/<account>/Mes Documents/mydir"
returns 1 if mydir does exist, or 0 if not.
This is correct.

file writable "C:/Documents and Settings/"
returns also 1, which is correct.

But:
file writable "C:/Documents and 
Settings/<account>/Mes Documents"
returns 0 but it should be 1

<account> is my account name (with administrator 
rights), this directory of course exists and I'm allowed to 
write files in it.

 ===

Attached files implement a solution based on the 
original bug. The source is based on the Tcl 8.4.11 
source and encompasses the changes by dkf. The 
patch should still be easily applied on the CVS HEAD.
jfg118plain2005-11-01 12:21:58
File Added - 154636: win-tclWinFile.c.diff-u
jfg118plain2005-11-01 12:23:07
File Added - 154637: win-tclWin32Dll.c.diff-u
jfg118plain2005-11-01 12:24:22
File Added - 154638: win-tclWinInt.h.diff-u
dkfplain2005-11-01 18:34:22
data_type - 310894
fvogelnew1plain2005-12-02 03:17:46
Logged In: YES 
user_id=1245417

Hi, 
 
Could you please apply your patch at least to the 8.4.11 
branch so that it will be included in the upcoming 8.4.12? 
 
I really need this feature. 
 
Thanks a lot, 
Francois
fvogelnew1plain2006-03-06 02:56:02
Logged In: YES 
user_id=1245417

Hi all,

It's now ten months since I opened the original bug 
(1193497), and 4 months since a patch has been kindly 
derived, and I really thank you for that.

Everything seems to be ready for inclusion in the next Tcl 
release, but nothing happens. Why?

What can I do to speed up the process? Can I be of any 
help, or should I just wait for some TCT member to review 
the patch and apply it to the codebase?

I'm more than willing to help, but can't find any advice 
on how to do it. My knowledge of Tcl internals or ACL list 
is rather limited, but I'm ready to try whatever task is 
required.

Thanks,
Francois
patthoytsplain2006-03-08 04:59:49
Logged In: YES 
user_id=202636

As it stands this patch cannot be applied as it requires
Win32 API features that are only available on NT systems.
jfg118plain2006-03-08 05:25:00
Logged In: YES 
user_id=1266631

How does Tcl handle other similar situations?  

It seems that it would be straight forward to use the old
method when running on non NT systems.  

From what I can see from MSDN the functions are available on
all Windows NT versions newer than 3.51.  This would mean it
would only be a problem on Win95/98/Me.  One could probably
dynamically load the DLL entry points, and if it fails fall
back to the old implementation.
jfg118plain2006-03-09 07:22:51
Logged In: YES 
user_id=1266631

Attached is a new patch which dynamically loads the NT
specific Windows API functions.  If the Windows API
functions can not be found, the fallback is to use the read
only flag as the function previously was implemented.

The attached patch is now a single file which has been
generated against the Tcl 8.4.12 source code.  The change
should be easily applied on CVS HEAD.
jfg118plain2006-03-09 07:22:52
File Deleted - 154638: 



File Added - 170266: win-tclWinFile.c.diff-u
jfg118plain2006-03-09 07:22:53
File Deleted - 154636:
vincentdarleyplain2006-03-09 18:30:43
Logged In: YES 
user_id=32170

Applied to cvs HEAD.
fvogelnew1plain2006-03-09 19:36:31
Logged In: YES 
user_id=1245417

Many many thanks to all contributors for this effort. I 
really appreciate it.

I understand that the next 8.5 release will then include 
the patch.

Is there any chance to have it also in the upcoming 
8.4.13? I would switch to 8.4.13 rather than 8.5 which is 
still alpha.

Thanks again,
Francois
jfg118plain2006-03-11 05:13:12
Logged In: YES 
user_id=1266631

Updated patch to only ignore the read-only flag if it is a
directory, as the directory is the only special case.
jfg118plain2006-03-11 05:13:13
File Deleted - 170266:
jfg118plain2006-03-11 05:14:00
File Added - 170510: win-tclWinFile.c.diff-u
jfg118plain2006-03-14 06:57:39
Logged In: YES 
user_id=1266631

Attached patch based on Tcl 8.4.12.  The patch modified the
testchmod command to apply an ACL change on windows to make
the directory non writable. Detailed testcase analysis on
duplicate bug 1193497.
jfg118plain2006-03-14 06:58:07
File Added - 170804: generic-testTcl.c.diff-u
vincentdarley Closed ticket [1344540fff]. [History diff]2006-03-20 02:37:48
Log in (anonymous is fine) to add a comment.

Attachments: