Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

file rename newbie help

7 views
Skip to first unread message

massimo...@gmail.com

unread,
May 30, 2005, 12:53:30 PM5/30/05
to
Hi all,

I have a (quite complex) tcl script with the line:

puts "EXIST [file exists $dumpDir]"
file rename $dumpDir $loadDir

and I get the output:

EXIST 0
error renaming "IAS-Finnat_5-1": no such file or directory
while executing
"file rename $dumpDir $loadDir"
(file "e:/cvs/xbrl/cvtdb/upgrade.tcl" line 43)

but the origin directory exists:

$ ls
CP04_5-0_Backup.mdb IAS-Finnat_5-0_ol.mdb IAS-Finnat_5-1.ldb
Prova_5-1.mdb
CP04_5-1.mdb IAS-Finnat_5-1 IAS-Finnat_5-1.mdb

the same behaviour is under Windows (XP) and under cygwin, both at 8.4

Any hint?

Thanks,

Massimo

Khaled

unread,
May 30, 2005, 1:15:55 PM5/30/05
to

Does the directory you want to rename exist under the same directory
where you launch your script? Try providing the full path to [file
rename], for both $dumpDir and $loadDir.

Rgrds,
Khaled

Michael Schlenker

unread,
May 30, 2005, 1:16:39 PM5/30/05
to
the file rename works in the current pwd, so if your script is not
running inside it, you will have to build the path with [file join]
for example.

Michael

Massimo

unread,
May 31, 2005, 3:52:10 AM5/31/05
to
Tks Khaled and Michael,

everything was correct, but there was a subtle behaviour before the
failing statement causing the script to work "inside" the directory
that has to be renamed.

A simple:

cd ..

before the file rename was enough; your suggestions helped me to debug
the problem.

Massimo

0 new messages