Home > Archive > Tcl > March 2006 > Re: using exec and pkzip
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: using exec and pkzip
|
|
| Bruce Hartweg 2006-03-29, 7:04 pm |
|
Willie wrote:
> Hi All;
>
> Bit of a newbie at TCL.
>
> I have a bit of code like:
> "exec pkzip apple.zip apple.txt apple.cus apple.prc apple.zon"
>
> The files are fairly large and I get the error "The system cannot execute
> the specified program"
>
> If I only zip 2 files or smaller files I don't get the error. I created a
> batch file to zip the files and that works. How can I get the exec command
> to work? Is it a buffer variable?
>
no exec is running the a separate process.
please post the exact code you are running,
and the exact error messages you get, also
any info on what system/OS you are running,
version of tcl.
Bruce
| |
| Willie 2006-03-29, 10:01 pm |
|
"Bruce Hartweg" <bruce-news@hartweg.us> wrote in message
news:ONyWf.2$Hj6.1@dfw-service2.ext.ray.com...
>
>
> Willie wrote:
> no exec is running the a separate process.
>
> please post the exact code you are running,
> and the exact error messages you get, also
> any info on what system/OS you are running,
> version of tcl.
>
> Bruce
I'm running this on WinXP Active TCL 8.4.12
<Exact code:>
set zipExe "y:/bin/pkzip.exe"
set pdfDir "y:/PDFHosts/Malabar/data"
set ordFile "$pdfDir/apple.txt"
set custFile "$pdfDir/apple.cus"
set arFile "$pdfDir/apple.oar"
set priceFile "$pdfDir/apple.prc"
if {[catch {exec $zipExe $zipFile $ordFile $custFile $arFile} result]} {
global errorInfo; logger "\nERROR ZIPPING ORDER FILES:" true; logger
$errorInfo true; mailLog
}
</Exact Code:>
$errorInfo returns as "The System cannot execute the specified program"
If I only zip 2 files at a time it works. I have worked around this by
zipping each file seperately appending them together. But I still think it
strange that I can do in a batch(.bat)file and not in Tcl.
<batch file>
y:
CD \
cd \PDFHosts\malabar\data
y:\pkzip apple.zip apple.txt apple.oar apple.prc apple.cus
</batch file>
Thanks for your attention.
--
NewsGuy.Com 30Gb $9.95 Carry Forward and On Demand Bandwidth
| |
| Bruce Hartweg 2006-03-29, 10:01 pm |
|
Willie wrote:
> "Bruce Hartweg" <bruce-news@hartweg.us> wrote in message
> news:ONyWf.2$Hj6.1@dfw-service2.ext.ray.com...
> I'm running this on WinXP Active TCL 8.4.12
> <Exact code:>
> set zipExe "y:/bin/pkzip.exe"
> set pdfDir "y:/PDFHosts/Malabar/data"
> set ordFile "$pdfDir/apple.txt"
> set custFile "$pdfDir/apple.cus"
> set arFile "$pdfDir/apple.oar"
> set priceFile "$pdfDir/apple.prc"
> if {[catch {exec $zipExe $zipFile $ordFile $custFile $arFile} result]} {
> global errorInfo; logger "\nERROR ZIPPING ORDER FILES:" true; logger
> $errorInfo true; mailLog
> }
> </Exact Code:>
> $errorInfo returns as "The System cannot execute the specified program"
> If I only zip 2 files at a time it works. I have worked around this by
> zipping each file seperately appending them together. But I still think it
> strange that I can do in a batch(.bat)file and not in Tcl.
> <batch file>
> y:
> CD \
> cd \PDFHosts\malabar\data
> y:\pkzip apple.zip apple.txt apple.oar apple.prc apple.cus
> </batch file>
>
> Thanks for your attention.
The Tcl code looke fine as far as Tcl goes, and I'm not a Windows
guy in general, but you might be hitting a limitation of the length
a command line? in you batch script you cd into the target dir and
use single word names as argument, the tcl version is using full
path names. You could test this by changeing you batch file to use
the fully specifed names, and or change the tck code to CD and use
the short names. Or maybe it's something else entirely, and a windows
guru can give you some help.
Bruce
|
|
|
|
|