in reply to IPC::Run and Win32::Process::Create

Update: seems like this workaround is pretty solid...
my $file = Win32::GetShortPathName($scpfile->Text()); $file =~ /(.*\\).*$/; print "CD to $1\n"; Win32::SetCwd($1);
Not the prettiest bit of code, but I wanted to see if the cwd could be to blame. I still don't get why I have this problem in the first place; I pass the absolute path to the file (works from a direct command line incantation of pscp). This workaround means I have to send the absolute path to pscp now, but no biggie there. If anyone can explain what I ran into with this, please let me know!!

Replies are listed 'Best First'.
Re^2: IPC::Run and Win32::Process::Create
by BrowserUk (Patriarch) on Jul 09, 2004 at 18:23 UTC

    I suspect that the error text caught Bad file descriptor: Win32::Process::Create()... is unrelated to the problem you were having. Your probably still getting that msg even with your work-around. It is probably benign.

    It would be interesting to substitute a .bat file for the PSPC command and see what the actual parameters that are being received by the called program are (prior to your fix), along with the cwd at that point.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algoritm, algorithm on the code side." - tachyon