Artifacts Associated With Ticket c7aa14ffdd2507dd
Ticket change [2304fa4e87] (rid 146568) by anonymous on 2016-04-25 09:16:46:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Tested on RHEL 6.5 (Linux 2.6.32-431.el6.x86_64) and Tcl 8.5.7. From the Linux command line with LANG set to C I can create and manipulate the following file in a bash shell: % echo "Test it" > 'test{' % cat 'test{' However if I start tclsh the following happens: % set name [glob test*] test\{ % set fh [open $name r] couldn't open "test\{": no such file or directory The encoding seems to have been defaulted to iso8859-1 but this seems to mean that certain files cannot be accessed reliably in Tcl. % encoding system iso8859-1 - foundin initialized to: "8.5.16"
- is_private initialized to: "0"
- login: "anonymous"
- priority initialized to: "5 Medium"
- private_contact initialized to: "6a3810e551109494cf10711fdd242d10cbfd3a32"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "anonymous"
- subsystem initialized to: "- New Builtin Commands"
- title initialized to: "Linux C locale and filenames"
- type initialized to: "Bug"
Ticket change [d603c8d4b5] (rid 146569) by jan.nijtmans on 2016-04-25 09:45:29:
- icomment:
The reason for this is that [glob] returns a list of files, not a filename, that's why the '\' needs to be inserted to form a valid Tcl list. So, your code should be (assuming you want to open the first file in the glob list): % set name [lindex [glob test*] 1] test{ % set fh [open $name r] file3 - login: "jan.nijtmans"
- mimetype: "text/plain"
- icomment:
Ticket change [2d6ffd0194] (rid 146570) by jan.nijtmans on 2016-04-25 09:46:04:
- assignee changed to: "jan.nijtmans"
- closedate changed to: "2457503.90699108"
- closer changed to: "jan.nijtmans"
- login: "jan.nijtmans"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"
Ticket change [af02851110] (rid 146571) by dgp on 2016-04-25 15:49:02:
- closedate changed to: "2457504.15905155"
- closer changed to: "dgp"
- icomment:
Caution: Tcl list indices start with 0, not 1.
- login: "dgp"
- mimetype: "text/plain"