From: Rui Aurelio
Subject: excl:run-shell-command  »  backslash vs forwardslash  »  Unix vs Windows
Date: 
Message-ID: <629ed60d.0206110840.592cb69b@posting.google.com>
Good afternoon "people",

   I'm a newbie in Lisp matters and I'm having a stupid problem that
has to do with the dir/subdir separator character in the Windows
environment. I'm trying to use the  excl:run-shell-command  function,
in two ways:

  � "pkzip -pr c:\mydir\fich.zip c:\mydir2\*.*", Allegro will
translate it to "pkzip -pr c:mydirfich.zip c:mydir2*.*"

  � "pkzip -pr c:\\mydir\\fich.zip c:\\mydir2\\*.*", Allegro will
translate it to "pkzip -pr c:/mydir/fich.zip c:/mydir2/*.*"

  In Windows environment, both situations will fail. I believe there
must exist a way to kick this problem off, but I don't know how. This
is important for me because I don't intend to switch to an Unix/Linux
environment (in which the command will work, certainlly).

   By the way, I'm using Allegro 5.0.1 for Windows.

   Thanks in advance for your kind help. Have a nice "lisping" day.

Rui Aurelio

From: Barry Margolin
Subject: Re: excl:run-shell-command  »  backslash vs forwardslash  »  Unix vs Windows
Date: 
Message-ID: <QTpN8.15$9n1.1271@paloalto-snr2.gtei.net>
In article <····························@posting.google.com>,
Rui Aurelio <········@siscog.pt> wrote:
>Good afternoon "people",
>
>   I'm a newbie in Lisp matters and I'm having a stupid problem that
>has to do with the dir/subdir separator character in the Windows
>environment. I'm trying to use the  excl:run-shell-command  function,
>in two ways:
>
>  � "pkzip -pr c:\mydir\fich.zip c:\mydir2\*.*", Allegro will
>translate it to "pkzip -pr c:mydirfich.zip c:mydir2*.*"

Backslash is a special character in Lisp strings, it's used to escape the
character that follows it.  The backslash itself then disappears.  If you
want a backslash to appear in a string, you have to escape it with a
backslash.

>
>  � "pkzip -pr c:\\mydir\\fich.zip c:\\mydir2\\*.*", Allegro will
>translate it to "pkzip -pr c:/mydir/fich.zip c:/mydir2/*.*"
>
>  In Windows environment, both situations will fail. 

I doubt that ACL is doing this translation.  And even if it does, I think
it should work anyway -- I thought that Windows allows both \ and / as
directory separator characters.

-- 
Barry Margolin, ······@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: Rui Aurelio
Subject: Re: excl:run-shell-command  »  backslash vs forwardslash  »  Unix vs Windows
Date: 
Message-ID: <629ed60d.0206120131.72877129@posting.google.com>
Barry Margolin <······@genuity.net> wrote in message news:<·················@paloalto-snr2.gtei.net>...
> In article <····························@posting.google.com>,
> Rui Aurelio <········@siscog.pt> wrote:
> >Good afternoon "people",
> >
> >   I'm a newbie in Lisp matters and I'm having a stupid problem that
> >has to do with the dir/subdir separator character in the Windows
> >environment. I'm trying to use the  excl:run-shell-command  function,
> >in two ways:
> >
> >  � "pkzip -pr c:\mydir\fich.zip c:\mydir2\*.*", Allegro will
> >translate it to "pkzip -pr c:mydirfich.zip c:mydir2*.*"
> 
> Backslash is a special character in Lisp strings, it's used to escape the
> character that follows it.  The backslash itself then disappears.  If you
> want a backslash to appear in a string, you have to escape it with a
> backslash.
> 
> >
> >  � "pkzip -pr c:\\mydir\\fich.zip c:\\mydir2\\*.*", Allegro will
> >translate it to "pkzip -pr c:/mydir/fich.zip c:/mydir2/*.*"
> >
> >  In Windows environment, both situations will fail. 
> 
> I doubt that ACL is doing this translation.  And even if it does, I think
> it should work anyway -- I thought that Windows allows both \ and / as
> directory separator characters.


Hello,

   thank you very much Paul, for your kind and so fast answer. I've
tried your suggestion #("pkzip" "pkzip" ...) but ACL says the
following:  "Error: On Windows the first argument to run-shell-command
must be a string."

   When you said that Windows accepts both slashes, I went to the DOS
prompt (on my Windows NT machine) and ran a few tests with PKZIP
v2.50. Conclusion: I was trying to create a zip file on a directory
exceeding the 8.3 name structure. Example:
  excl:run-shell-command "pkzip -pr d:\\mydir\\f.zip d:\\mydir\\*.*"  
�   OK
  excl:run-shell-command "pkzip -pr d:\\mydir_1\\f.zip
d:\\mydir_1\\*.*"   �   OK
  excl:run-shell-command "pkzip -pr d:\\mydirsome\\f.zip
d:\\mydirsome\\*.*"   �   DOESN'T WORK

   After this conclusion, I've searched for some other zip program
with command line feature, and I found that PKZIP25 works fine in the
three above mentioned situations.

   I'm sorry for not testing PKZIP deeply before putting this question
about ACL. Your help was invaluable for me (and my work). Thanks a
lot.

Rui Aurelio
From: Barry Margolin
Subject: Re: excl:run-shell-command  »  backslash vs forwardslash  »  Unix vs Windows
Date: 
Message-ID: <GVIN8.3$O26.197@paloalto-snr1.gtei.net>
In article <····························@posting.google.com>,
Rui Aurelio <········@siscog.pt> wrote:
>Barry Margolin <······@genuity.net> wrote in message
>news:<·················@paloalto-snr2.gtei.net>...
>> I doubt that ACL is doing this translation.  And even if it does, I think
>> it should work anyway -- I thought that Windows allows both \ and / as
>> directory separator characters.
>
>   thank you very much Paul, for your kind and so fast answer. I've
>tried your suggestion #("pkzip" "pkzip" ...) but ACL says the
>following:  "Error: On Windows the first argument to run-shell-command
>must be a string."

My name is Barry, not Paul.  And I didn't make any suggestions.  It looks
like the above message is in reference to a private email, not my post that
you replied to.

-- 
Barry Margolin, ······@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: Joel Ray Holveck
Subject: Re: excl:run-shell-command  »  backslash vs  forwardslash  »  Unix vs Windows
Date: 
Message-ID: <y7c1ybdjef4.fsf@sindri.juniper.net>
>   � "pkzip -pr c:\\mydir\\fich.zip c:\\mydir2\\*.*", Allegro will
> translate it to "pkzip -pr c:/mydir/fich.zip c:/mydir2/*.*"

The output of pkzip translates backslashes to forward slashes (or used
to, last time I used it).  Is that what you're seeing?

Cheers,
joelh