Overview
| Artifact ID: | e9547fed5d1c5c9370713521f72b489da40c714f |
|---|---|
| Ticket: | 1622579fffffffffffffffffffffffffffffffff
open fails to open hidden files for writing |
| User & Date: | patthoyts on 2007-01-03 20:40:45 |
Changes
- closedate changed to: "2007-01-03T13:40:45"
- closer changed to: "patthoyts"
- icomment:
Logged In: YES user_id=202636 Originator: NO "give it the readonly attribute" You mean hidden. The issue here is that the file exists already with non-default attributes. Mode 'w' means WRONLY|CREAT|TRUNC which is translated into OPEN_ALWAYS and as we look like we are creating the file we expect to set the attributes to FILE_ATTRIBUTE_NORMAL. As the file exists but has FILE_ATTRIBUTE_HIDDEN we get a permission denied from windows. The solution is to open with appropriate flags: % set f [open z.txt w]; puts $f test; close $f % file attributes z.txt -hidden 1 % % list [set f [open z.txt w]] [close $f] couldn't open "z.txt": permission denied % list [set f [open z.txt a]] [close $f] filea260e8 {} % list [set f [open z.txt a+]] [close $f] filea21648 {} % list [set f [open z.txt "WRONLY CREAT"]] [close $f] filea26150 % list [set f [open z.txt "WRONLY CREAT TRUNC"]] [close $f] couldn't open "z.txt": permission denied I don't think this is a bug myself. - login: "patthoyts"
- mimetype: "text/plain"
- resolution changed to: "Wont Fix"
- status changed to: "Pending"
- username: "patthoyts"