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 mookie
10 days ago
tcl by cgm
12 days ago
tcl by egavilan
18 days ago
tcl by smlckz
19 days ago
tcl by Guest86
23 days ago
tcl by mookie
25 days ago
tcl by greycat
30 days ago
tcl by mookie
38 days ago
tcl by mookie
38 days ago
tcl by mookie
43 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