function popen and spaces in the path or file name

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • freak

    #1

    function popen and spaces in the path or file name

    Sorry , corrections to my script

    Have a problem with spaces in the function popen
    Next example works fine:
    ...
    $drive="c:";
    $path="";
    $file="\\myfile .exe"">";
    $call = $drive.$path.$f ile;
    pclose(popen('s tart /b '.$call.'', 'r'));

    .....
    Using "Program Files" in the path name
    $path=" \\Program Files"; (error: "c:\Program ... " not found)
    or
    $path=" \\Program%20Fil es"; (error: "c:\Program%20F iles ... " not found)

    thus this will not work!!!!!!!!

    Please help me


  • Erwin Moller

    #2
    Re: function popen and spaces in the path or file name

    freak wrote:
    [color=blue]
    > Sorry , corrections to my script
    >
    > Have a problem with spaces in the function popen
    > Next example works fine:
    > ...
    > $drive="c:";
    > $path="";
    > $file="\\myfile .exe"">";
    > $call = $drive.$path.$f ile;
    > pclose(popen('s tart /b '.$call.'', 'r'));
    >
    > ....
    > Using "Program Files" in the path name
    > $path=" \\Program Files"; (error: "c:\Program ... " not found)
    > or
    > $path=" \\Program%20Fil es"; (error: "c:\Program%20F iles ... " not found)
    >
    > thus this will not work!!!!!!!!
    >
    > Please help me[/color]

    Hi,

    Did you try escaping the space, just like you escape the \?
    $path=" \\Program\ Files";
    (not tested)

    Regards,
    Erwin Moller

    Comment

    • freak

      #3
      Re: function popen and spaces in the path or file name


      "Erwin Moller"
      <since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c om> schreef in
      bericht news:444cb835$0 $31639$e4fe514c @news.xs4all.nl ...[color=blue]
      > freak wrote:
      >[color=green]
      >> Sorry , corrections to my script
      >>
      >> Have a problem with spaces in the function popen
      >> Next example works fine:
      >> ...
      >> $drive="c:";
      >> $path="";
      >> $file="\\myfile .exe"">";
      >> $call = $drive.$path.$f ile;
      >> pclose(popen('s tart /b '.$call.'', 'r'));
      >>
      >> ....
      >> Using "Program Files" in the path name
      >> $path=" \\Program Files"; (error: "c:\Program ... " not found)
      >> or
      >> $path=" \\Program%20Fil es"; (error: "c:\Program%20F iles ... " not found)
      >>
      >> thus this will not work!!!!!!!!
      >>
      >> Please help me[/color]
      >
      > Hi,
      >
      > Did you try escaping the space, just like you escape the \?
      > $path=" \\Program\ Files";
      > (not tested)
      >
      > Regards,
      > Erwin Moller[/color]

      Yes I have tested it and no solution!


      Comment

      Working...