Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

How let Inline tell space in path?

by xiaoyafeng (Deacon)
on Oct 24, 2007 at 04:45 UTC ( [id://646823]=perlquestion: print w/replies, xml ) Need Help??

xiaoyafeng has asked for the wisdom of the Perl Monks concerning the following question:

I found Inline will abort when directory name include space. For example:
use strict; use warnings; use Inline C => Config => LIBS => '-luser32'; use Inline C => << 'CODE'; #include <windows.h> int Winbox(char* Caption, char* Text) { return MessageBoxA(0,Text,Caption,0); } CODE my $text = 'don\'t let me down!!!'; Winbox('Inline Text Box', $text); __OUTPUT__ C:\Documents and Settings>perl -c winbox.pl Can't open C:\Documents\config for output. No such file or directory at -e line 0 BEGIN failed--compilation aborted. Failed to autogenerate C:\Documents and Settings\_Inline\config. at winbox.pl line 27 BEGIN failed--compilation aborted at winbox.pl line 32.
Any suggestions?


I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

Replies are listed 'Best First'.
Re: How let Inline tell space in path?
by syphilis (Archbishop) on Oct 24, 2007 at 05:45 UTC
    You can get around that immediate problem by copying the _Inline/config file from another location into the C:\Documents and Settings\_Inline folder - ie run an Inline::C script in (say) C:\nospaces, then copy C:\nospaces\_Inline\config across to the C:\Documents and Settings\_Inline folder.

    But, with gcc at least, that only defers the problem. You'll get to the stage where gcc -c  -IC:/Documents and Settings ... gets run - but it needs to be run as something like gcc -c  "-IC:/Documents and Settings" ....
    To fix that problem you need to hack at C.pm. There's a patch at http://rt.cpan.org/Public/Bug/Display.html?id=4150 which you might find useful. I think (not sure) Eric Wilhelm has a build of Inline (google for Inline-0.44_01) that does permit the running of scripts inside directories with spaces.

    For mine, the best solution is to not run Inline scripts in paths with spaces. In fact, one would be best advised to *never* enter such locations under any circumstances whatsoever.

    Cheers,
    Rob

      Which highlights how system needs to be fixed on Win32 so that

      my $cc= 'c:/opensource tools/gcc/gcc.exe'; my $flag= "-lIcorice"; my $file= 'c:/dockets and filings/case.c'; system( $cc, $flag, $file );

      puts the needed quotes around the first and third "arguments" when constructing the command line to be used. Well, at least it highlights that to me.

      - tye        

      *shrug* It's Inline. It's built on assumptions. That there's no spaces is just another unreasonable one.

      ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

        *shrug* It's Inline. It's built on assumptions. That there's no spaces is just another unreasonable one

        Both nmake and dmake are built on the same assumption. I therefore (personally) don't see any reason that Inline should do otherwise.

        Cheers,
        Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://646823]
Approved by ikegami
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2024-04-19 09:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found