Forward- and Backslashes as Pathname Delimiters 
Author Message
 Forward- and Backslashes as Pathname Delimiters

Quote:

>Hello,
>are no arguments); meanwhile,
>$pid = system(P_WAIT, 'SGMLBLD.EXE /INPUT:C:\BUILD\EB424\SGML-IN.BIF');
>fails with an error stating: Can't spawn "SGMLBLD.EXE
>/INPUT:C:\BUILD\EB424\SGML-IN.BIF": No such file or directory at
>n:systest.p line 58. system call returned the following:--->255<---
>Am I correct in assuming this result is because the forward-slash
>preceding the INPUT parameter is being taken by the perl interpreter as a
>pathname?

read up on how the \ works

it works as a pair with the following character

when I am doing what you appear to want to do, I do the following:

$file="SGMLBLD.EXE \/INPUT:C:\\BUILD\\EB424\\SGML-IN.BIF
print "lets just see what we got $file";

Quote:
>$pid = system($file);



Thu, 09 Sep 1999 03:00:00 GMT  
 Forward- and Backslashes as Pathname Delimiters

[cc'd and posted]

I hope [expect] someone will correct me if I misremember, but I recall
that system expects a list to submit.  Your system list looks like one
command (P_WAIT) with one argument
('SGMLBLD.EXE /INPUT:C:\BUILD\EB424\SGML-IN.BIF').  I think it should
look like:

$pid = system(P_WAIT, SGMLBLD.EXE, /INPUT:C:/BUILD/EB424/SGML-IN.BIF);

I don't know OS/2, but I believe it accepts forward slashes as path
component delimiters.

Hope this helps!

Quote:

>Hello,

>Perhaps this picks up on a thread that seems to have ended a while ago,
>but here it is: In Perl for OS/2, are the forward-slash and backslash
>both recognized as pathname delimiters? I encounter errors using system
>to call programs with arguments which are set off by forward slashes. So,
>for example:

>$pid = system(P_WAIT, 'SGMLBLD.EXE');

>will correctly attempt to spawn the process (which fails because there
>are no arguments); meanwhile,

>$pid = system(P_WAIT, 'SGMLBLD.EXE /INPUT:C:\BUILD\EB424\SGML-IN.BIF');
>fails with an error stating: Can't spawn "SGMLBLD.EXE
>/INPUT:C:\BUILD\EB424\SGML-IN.BIF": No such file or directory at
>n:systest.p line 58. system call returned the following:--->255<---

[...]
--
Donald.
These opinions were formulated by a trained professional.
              DO NOT TRY THIS AT HOME!
      At the time, the tone will be ... BEEP!


Thu, 09 Sep 1999 03:00:00 GMT  
 Forward- and Backslashes as Pathname Delimiters


Quote:
> Thanks to everyone for the input. In the end, it was Donald's suggestion
> that got it working. The solution was:

> $pid = system(P_WAIT, 'sgmlbmd', 'arg1', arg2');

> Single quotes were necessary.

Not for those strings, they aren't. Those are the same even if you put
them in double quotes. (Although I have to assume that you meant to put
one before arg2.)

Of course, it doesn't hurt to put strings like that into single quotes.
But I wouldn't want anybody reading this newsgroup to think that there was
some kind of a rule that strings being passed in a system call need to be
quoted with single quotes.

-- Tom Phoenix        http://www.teleport.com/~rootbeer/

Randal Schwartz Case:     http://www.lightlink.com/fors/



Sat, 11 Sep 1999 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Substituting backslash for 2 forward slashes

2. Perl Gtk -- Bring a window forward

3. Step through Hash Keys forward and backward

4. Race conditions and ~/.forward script

5. Small program to emulate snmpd and forward to syslog

6. Perl Gtk -- Bring a window forward

7. Using .forward file to trigger Perl script

8. Changing back slashes to forward slashes

9. How to forward-declare a file handle?

10. script to forward email

11. Forward engineering Perl from Dia

12. Erroneous Forward Slash in HTML Code by CGI.pm

 

 
Powered by phpBB® Forum Software