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
34 days ago
tcl by oldlaptop
38 days ago
tcl by rhobart
51 days ago
tcl by rhobart
51 days ago
tcl by rhobart
52 days ago
tcl by Bradipo
52 days ago
tcl by rhobart
52 days ago
tcl by sssc
55 days ago
tcl by mookie
72 days ago
tcl by JMN
79 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