jlongino has asked for the wisdom of the Perl Monks concerning the following question:
Yet, if I make a slight change:use strict; use Win32::Process; use Win32; Win32::Process::Create($Win32::Process::Create::ProcessObj, "/my files/jim/perl monks/tkwarn.exe", # path to executable '', # command line args 0, # Don't inherit stuff DETACHED_PROCESS, # flags for creation "C:/my files/jim/perl monks") or # current dir. die print_error(); sub print_error() { return Win32::FormatMessage( Win32::GetLastError() ); }
I get the error message:"C:/my files/jim/perl monks/tkwarn.exe", # path to executable
Now ordinarily I wouldn't think this was so strange, except the Perl Cookbook has the example:The system cannot find the file specified.
I wondered if the "current dir" path I gave would cause a similar problem so I gave an invalid directory for "current dir" and received an error message:# loader - starts Perl scripts without the annoying DOS window use strict; use Win32; use Win32::Process; # Create the process object. Win32::Process::Create($Win32::Process::Create::ProcessObj, 'C:/perl5/bin/perl.exe', # Whereabouts of Perl 'perl realprogram', # 0, # Don't inherit. DETACHED_PROCESS, # ".") or # current dir. die print_error(); sub print_error() { return Win32::FormatMessage( Win32::GetLastError() ); }
So . . . it likes "C:" in the current dir spec, but not in the executable file spec? If anyone could help me to understand this I would be most grateful.The directory name is invalid.
"It is much more comfortable to be mad and know it, than to be sane and have one's doubts." -- G. B. Burgin
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: No useful device on path to madness
by Zaxo (Archbishop) on Sep 29, 2001 at 10:10 UTC | |
by jlongino (Parson) on Sep 29, 2001 at 11:34 UTC | |
|
Re: No useful device on path to madness
by jlongino (Parson) on Sep 30, 2001 at 00:18 UTC | |
|
Re: No useful device on path to madness
by C-Keen (Monk) on Sep 29, 2001 at 13:25 UTC | |
by jlongino (Parson) on Sep 29, 2001 at 14:35 UTC | |
|
Re: No useful device on path to madness
by rchiav (Deacon) on Sep 29, 2001 at 22:13 UTC | |
|
Re: No useful device on path to madness
by schumi (Hermit) on Sep 29, 2001 at 22:22 UTC |