file can't hande filenames with newlines
Posted to
tcl
by venks at Thu Aug 13 07:45:53 GMT 2009
view raw
%
info
patchlevel
8.6b1.1
%
set
fo [
open
"y\nb" w];
puts
$fo
foo;
close
$fo
%
glob
y*
{y
b}
%
file
rename [
glob
y*] z0
error
renaming "{y
b}": no such
file
or directory
%
Comments
Posted by venks at Thu Aug 13 07:48:25 GMT 2009
[text]
[code]
Solution is to use lindex here: % file rename [lindex [glob y*] 0] z0 % glob z0 z0
Solution is to use
lindex
here:
%
file
rename [
lindex
[
glob
y*] 0] z0
%
glob
z0
z0
Recent Posts
tcl by oldlaptop
5 days ago
tcl by mookie
11 days ago
tcl by dandyn
17 days ago
tcl by Bradipo
17 days ago
tcl by Bradipo
17 days ago
tcl by oldlaptop
42 days ago
tcl by oldlaptop
42 days ago
tcl by mookie
47 days ago
tcl by mookie
47 days ago
tcl by georgtree
49 days ago
Submit
New paste
Documentation
From Jabber
Comments
Posted by venks at Thu Aug 13 07:48:25 GMT 2009 [text] [code]
Solution is to use lindex here: % file rename [lindex [glob y*] 0] z0 % glob z0 z0