I finally worked around the system() limitations by using
Win32::Process::Create.
Works with long file names, returns correct exit codes, etc.


        use Win32::Process;
        my ($myProc,$myResult,$myExit);
        $myResult = 0;
        Win32::Process::Create( $myProc,
                "$Mydir\\$Mycmd",
                "mycmd $workdir",
                0,
                NORMAL_PRIORITY_CLASS,
                "$workdir") || die ErrorReport();
        while( !$myResult )
        {
                $myResult = $myProc->Wait(1000);
        }
        $myProc->GetExitCode($myExit);
        printf("\nExit Code: %d\n",$myExit);
        # Do error checking


=======================================================
Andy Webb            [EMAIL PROTECTED]      www.swinc.com
Simpler-Webb, Inc.   Austin, TX            512-322-0071
-- Eating XXX Chili at Texas Chili Parlor since 1989 --
======================================================= 


-----Original Message-----
From: Tai [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 14, 2001 2:15 PM
To: [EMAIL PROTECTED]
Subject: qx usage?


Hi,
        Trying to muck with the FCheck (a file integrity checker),
and due to my poor understanding of qx and the various '`" and such,
I'm tearing my hair out.  

$HASHFunc = "C:\\fcheck\\md5sum.exe";
$filename = "c:\\temp\somelongfilename.txt";

$shortname = Win32::GetShortPathName($filename);

$x = qx("$HASHFunc $shortname");

        Two problems.  First is that I can't make the qx call with
$filename, have to use $shortname - why?  Second is that if I use
$filename = "c:\\temp\some&longfilename", qx still don't want to
work, saying that it can't find "some&l~1" - apparently not liking
the "&" in the name.

        How do I work around both of these?  Thanx for any help.

-Tai
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin

Reply via email to