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 schelte
4 days ago
tcl by Bombo
8 days ago
tcl by egavilan
16 days ago
tcl by bch
22 days ago
tcl by Bradipo
22 days ago
tcl by aspect
22 days ago
tcl by Bradipo
22 days ago
tcl by Bradipo
22 days ago
tcl by Bradipo
22 days ago
lilypond by Bradipo
24 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