Re: problem with special characters in file command?



Gerald W. Lester schrieb:
M. Strobel wrote:
Hi,

I am writing a script that works on files uploaded via FTP. The uploading system is coding a lot of info into the filename, they get really weird.

Now I get a problem with [file rootname] and [file exists] even in plain tclsh.

What is the exact "problem" you are getting?


I scan a directory for *.wav files, then I check for the existence of a corresponding .xml file. The file is there, but is not found.

See the lines "set f ..." and "set fjob ...", then "file readable .."


Tcl should be able to handle anything the file system can handle.


Exactly what I think, but not what I experience in this case.


Test session: (the file name is wrapped, there is a space in it, should not be the problem)
-------------------------------------------------------------------------------

% set f [lindex [glob *.wav] 0]
2$wav@@4$27-06-2008@@6$00$06@@7$27-06-2008 08$45$34@@8$²²@@29$24@@91$!QBLFUX0M@@31$1@@28$0@@.wav
% ls -l
insgesamt 52
-rw-rw-r-- 1 dictanet users 49025 27. Jun 08:46 2$wav@@4$27-06-2008@@6$00$06@@7$27-06-2008 08$45$34@@8$??@@29$24@@91$!QBLFUX0M@@31$1@@28$0@@.wav
-rw-rw-r-- 1 strobel users 97 27. Jun 08:46 2$wav@@4$27-06-2008@@6$00$06@@7$27-06-2008 08$45$34@@8$??@@29$24@@91$!QBLFUX0M@@31$1@@28$0@@.xml
% set fjob "[file rootname $f].xml"
2$wav@@4$27-06-2008@@6$00$06@@7$27-06-2008 08$45$34@@8$²²@@29$24@@91$!QBLFUX0M@@31$1@@28$0@@.xml
% file readable $fjob
0
% set tcl_version
8.4
----------------------------------------------------------------

It happens on Suse 10.2, file system is ext3.

Max


.



Relevant Pages