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
1 days ago
tcl by oldlaptop
6 days ago
tcl by rhobart
18 days ago
tcl by rhobart
18 days ago
tcl by rhobart
19 days ago
tcl by Bradipo
19 days ago
tcl by rhobart
19 days ago
tcl by sssc
23 days ago
tcl by mookie
39 days ago
tcl by JMN
46 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