Lisp HUG Maillist Archive

pathname with blank inside to open-pipe, LWw

Hello,

How to pass to open-pipe a pathname that has a blank inside (LWw Pro 4.4)?

(with-open-stream
     (s (sys:open-pipe
         (string-append
          (namestring
           "C:/Program Files/emacs/setup/bin/gnuclientw.exe")
          " -sqfw g:/pe/test.lisp")))
   (loop while (print (read-line s nil nil)))
   s)
 >
"'C:\\Program' n'est pas reconnu en tant que commande interne"
   (means 'C:\\Program' is unknown)
#<win32::two-way-pipe-stream 2067FFFC>


(namestring "C:/Program Files/emacs/setup/bin/gnuclientw.exe")
returns
"C:\\Program Files\\emacs\\setup\\bin\\gnuclientw.exe"


Francis


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________


Re: pathname with blank inside to open-pipe, LWw

On Mon, 08 Aug 2005 16:11:18 +0200, Francis Leboutte <f.leboutte@algo.be> wrote:

> How to pass to open-pipe a pathname that has a blank inside (LWw Pro 4.4)?

Try this:

  (with-open-stream
       (s (sys:open-pipe
            '("C:/Program Files/emacs/setup/bin/gnuclientw.exe"
              "-sqfw" "g:/pe/test.lisp")))
    (loop while (print (read-line s nil nil)))
    s)

Cheers,
Edi.

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________


Re: pathname with blank inside to open-pipe, LWw

At 8/08/2005 16:38, Edi Weitz wrote:
>On Mon, 08 Aug 2005 16:11:18 +0200, Francis Leboutte <f.leboutte@algo.be> wrote:
>
> > How to pass to open-pipe a pathname that has a blank inside (LWw Pro 4.4)?
>
>Try this:
>
>   (with-open-stream
>        (s (sys:open-pipe
>             '("C:/Program Files/emacs/setup/bin/gnuclientw.exe"
>               "-sqfw" "g:/pe/test.lisp")))
>     (loop while (print (read-line s nil nil)))
>     s)

Still problematic:
- emacs doesn't start (crashes, error is "-sqfw: unable to connect to server")
- if emacs is already running, test.lisp is opened in emacs but 
the emacs server doesn't notice it

Finally, if I put C:/Program Files/emacs/setup/bin in the path, this is working:

(sys:open-pipe "gnuclientw.exe -sqfw g:/pe/test.lisp")

Looks like a bug.

Thanks Edi,

Francis


>Cheers,
>Edi.
>
>______________________________________________________________________
>This email has been scanned by the MessageLabs Email Security System.
>For more information please visit http://www.messagelabs.com/email
>______________________________________________________________________


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________


RE: pathname with blank inside to open-pipe, LWw

Francis Leboutte wrote:
 
> How to pass to open-pipe a pathname that has a blank inside 
> (LWw Pro 4.4)?

I think this will work:

(concatenate 'string
             "\""
             (namestring "C:/Program
Files/emacs/setup/bin/gnuclientw.exe")
             "\"")

Simon



______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________


RE: pathname with blank inside to open-pipe, LWw

At 9/08/2005 10:45, Simon Katz wrote:
>Francis Leboutte wrote:
>
> > How to pass to open-pipe a pathname that has a blank inside
> > (LWw Pro 4.4)?
>
>I think this will work:
>
>(concatenate 'string
>              "\""
>              (namestring "C:/Program
>Files/emacs/setup/bin/gnuclientw.exe")
>              "\"")
>
>Simon

No, it shows the same symptoms as the suggestion of Edi.

e.g. if emacs is not running:
(with-open-stream
     (s (sys:open-pipe
         (list
          (concatenate 'string
                       "\""
                       (namestring "C:/Program Files/emacs/setup/bin/gnuclientw.exe")
                       "\"")
          "-sqfw" "g:/pe/test.lisp") ))
   (loop while (print (read-line s nil nil)))
   s)
 >
"Syntaxe du nom de fichier, de r?pertoire ou de volume incorrecte."
  (means bad syntax)

If emacs is already running, test.lisp file is opened in emacs 
but emacs server isn't aware of its presence.

Thanks,

Francis


>______________________________________________________________________
>This email has been scanned by the MessageLabs Email Security System.
>For more information please visit http://www.messagelabs.com/email
>______________________________________________________________________


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________


RE: pathname with blank inside to open-pipe, LWw

Francis Leboutte wrote:
> At 9/08/2005 10:45, Simon Katz wrote:
> >Francis Leboutte wrote:
> >
> > > How to pass to open-pipe a pathname that has a blank inside
> > > (LWw Pro 4.4)?
> >
> >I think this will work:
> >
> >(concatenate 'string
> >              "\""
> >              (namestring "C:/Program
> >Files/emacs/setup/bin/gnuclientw.exe")
> >              "\"")
> >
> >Simon
> 
> No, it shows the same symptoms as the suggestion of Edi.
> 
> e.g. if emacs is not running:
> (with-open-stream
>      (s (sys:open-pipe
>          (list
>           (concatenate 'string
>                        "\""
>                        (namestring "C:/Program 
> Files/emacs/setup/bin/gnuclientw.exe")
>                        "\"")
>           "-sqfw" "g:/pe/test.lisp") ))
>    (loop while (print (read-line s nil nil)))
>    s)
>  >
> "Syntaxe du nom de fichier, de r?pertoire ou de volume incorrecte."
>   (means bad syntax)
> 
> If emacs is already running, test.lisp file is opened in emacs 
> but emacs server isn't aware of its presence.

Perhaps this will work:

(with-open-stream
    (s (sys:open-pipe
        (concatenate
         'string
         "\""
         (namestring "C:/Program
Files/emacs/setup/bin/gnuclientw.exe")
         "\""
         " "
         "-sqfw"
         " "
         "g:/pe/test.lisp")))
  (loop while (print (read-line s nil nil)))
  s)

I don't have emacs installed, so I can't try it. But for me
the first of the following does not work but the second one
does:

(sys:open-pipe
 (namestring "C:/Program Files/TextPad 4/textpad.exe"))

(sys:open-pipe
 (concatenate
  'string
  "\""
  (namestring "C:/Program Files/TextPad 4/textpad.exe")
  "\""))

FWIW, SYS:CALL-SYSTEM-SHOWING-OUTPUT seems to be less fussy.

Simon



______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________


RE: pathname with blank inside to open-pipe, LWw

At 9/08/2005 14:07, Simon Katz wrote:
>Francis Leboutte wrote:
> > At 9/08/2005 10:45, Simon Katz wrote:
> > >Francis Leboutte wrote:
> > >
> > > > How to pass to open-pipe a pathname that has a blank inside
> > > > (LWw Pro 4.4)?
> > >
> > >I think this will work:
> > >
> > >(concatenate 'string
> > >              "\""
> > >              (namestring "C:/Program
> > >Files/emacs/setup/bin/gnuclientw.exe")
> > >              "\"")
> > >
> > >Simon
> >
> > No, it shows the same symptoms as the suggestion of Edi.
> >
> > e.g. if emacs is not running:
> > (with-open-stream
> >      (s (sys:open-pipe
> >          (list
> >           (concatenate 'string
> >                        "\""
> >                        (namestring "C:/Program
> > Files/emacs/setup/bin/gnuclientw.exe")
> >                        "\"")
> >           "-sqfw" "g:/pe/test.lisp") ))
> >    (loop while (print (read-line s nil nil)))
> >    s)
> >  >
> > "Syntaxe du nom de fichier, de r?pertoire ou de volume incorrecte."
> >   (means bad syntax)
> >
> > If emacs is already running, test.lisp file is opened in emacs
> > but emacs server isn't aware of its presence.
>
>Perhaps this will work:
>
>(with-open-stream
>     (s (sys:open-pipe
>         (concatenate
>          'string
>          "\""
>          (namestring "C:/Program
>Files/emacs/setup/bin/gnuclientw.exe")
>          "\""
>          " "
>          "-sqfw"
>          " "
>          "g:/pe/test.lisp")))
>   (loop while (print (read-line s nil nil)))
>   s)
>
>I don't have emacs installed, so I can't try it. But for me
>the first of the following does not work but the second one
>does:
>
>(sys:open-pipe
>  (namestring "C:/Program Files/TextPad 4/textpad.exe"))
>
>(sys:open-pipe
>  (concatenate
>   'string
>   "\""
>   (namestring "C:/Program Files/TextPad 4/textpad.exe")
>   "\""))

On my machine too (same example, I use textpad too :-)

It has maybe to do with how the arguments are managed by open-pipe or gnuclientw.exe

Anyway, at present time it's enough for me to just put C:/Program 
Files/emacs/setup/bin in the path and use (sys:open-pipe 
"gnuclientw.exe -sqfw g:/pe/test.lisp") that does work.


>FWIW, SYS:CALL-SYSTEM-SHOWING-OUTPUT seems to be less fussy.

Will keep this in mind.

Thanks for helping,

Francis


>Simon
>
>
>
>______________________________________________________________________
>This email has been scanned by the MessageLabs Email Security System.
>For more information please visit http://www.messagelabs.com/email
>______________________________________________________________________


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________


Updated at: 2020-12-10 08:51 UTC