TCL, UNIX, [exec] and lists
From: Phil Powell (soazine_at_erols.com)
Date: 12/31/03
- Next message: mark: "Re: using the microphone input port with linux"
- Previous message: Matt: "Installation"
- Next in thread: Paul Pluzhnikov: "Re: TCL, UNIX, [exec] and lists"
- Reply: Paul Pluzhnikov: "Re: TCL, UNIX, [exec] and lists"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 31 Dec 2003 12:24:50 -0800
Consider now this code in TCL:
# USE GZIP WITH TAR TO CREATE tar.gz ZIPPED FILE OF ALL FILES IN
$fileList
regsub -all {/} $defaultDir {--} defaultDisplayDir; # CONVERT DEFAULT
DIRECTORY NAME TO A FILE-FRIENDLY FORMAT
set defaultDisplayDir [string range $defaultDisplayDir 2 end]; #
REMOVE FIRST 2 --
set tarFileName $archivePath/${defaultDisplayDir}_[clock scan
now].tar.gz
set cannotGzip [catch {
exec tar zcf $tarFileName [string range $fileList 0 end]
} errMsg]
if {$cannotGzip} {
writeErr $errMsg
catch {exec rm $tarFileName} trash; # REMOVE "EMPTY" TAR FILE SINCE
ERROR OCCURRED AND NO FILES IMPORTED
exit
}
I am going to take the list $fileList and import it into a UNIX TAR
command to tar.gz up a bunch of files whose names are in $fileList
into a .tar.gz file.
Problem is, it constantly fails. Here is the error generated each
time I try to use it:
[31/Dec/2003:15:03:02] tar:
/../internship_application_orig12082003112901.php
/../internship_application_orig12162003113501.php
/../internship_application_1072289535.php
/../internship_application_1072290610.php
/../internship_application_1072290994.php
/../internship_application_1072291038.php
/../internship_application_1072292211.php
/../internship_application_1072293322.php: Cannot stat: No such file
or directory
tar: Error exit delayed from previous errors
(for security reasons I am substituting the actual directory path with
"/../", sorry)
It apparently thinks the file name is all of $fileList, it doesn't
seem to know that I am importing $fileList as a list of string values.
TCL knows what it is, but TAR does not.
Has anyone ever done [exec] with a list, using TCL 8.3 and Linux Red
Hat 7.3? I could use some advice here.
Thanx
Phil
- Next message: mark: "Re: using the microphone input port with linux"
- Previous message: Matt: "Installation"
- Next in thread: Paul Pluzhnikov: "Re: TCL, UNIX, [exec] and lists"
- Reply: Paul Pluzhnikov: "Re: TCL, UNIX, [exec] and lists"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|