Russell McManus | 14 Aug 19:53
Favicon

some pathname wildcard code


Something like the following might be useful in implementing support
for wild pathnames in DIRECTORY in abcl.

One issue that I aware of but did not address is that I used
STRING-EQUAL in a couple of places that might be incorrect on Windows
and/or OSX.

-russ

(defpackage :abcl-hacks
  (:use :common-lisp :java))

(in-package :abcl-hacks)

(defun make-name-and-type-matcher (pathname)
  (let ((name1 (pathname-name pathname))
        (type1 (pathname-type pathname)))
    (flet ((to-string (jstring)
             (jcall (jmethod (jclass "java.lang.String") "toString") jstring))
           (split-path-and-type (s)
             (let ((dot-pos (position #\. s)))
               (if dot-pos
                   (values (subseq s 0 dot-pos) (subseq s (1+ dot-pos)))
                   (values s "")))))
      (cond ((and (eql :wild name1)
                  (eql :wild type1))
             (lambda (jstring) 
               (declare (ignore jstring))
               t))
(Continue reading)

Erik Huelsmann | 15 Aug 07:46

Re: some pathname wildcard code

On Thu, Aug 14, 2008 at 7:55 PM, Russell McManus
<russell_mcmanus <at> yahoo.com> wrote:
>
> Something like the following might be useful in implementing support
> for wild pathnames in DIRECTORY in abcl.
>
> One issue that I aware of but did not address is that I used
> STRING-EQUAL in a couple of places that might be incorrect on Windows
> and/or OSX.

Hi!

I'm about to step onto a flight, but let me take a minute to say
thanks for the contribution! When having a cursory look at
pathnames.lisp, I think to see some of the code that you wrote down
here too. I didn't look at your code long enough though to find out
whether it solves the "wild parents" problem: the fact that the path
we're looking at can't itself contain wildcard patterns (or at least,
that's the bug).

Bye,

Erik.

> -russ
>
>
> (defpackage :abcl-hacks
>  (:use :common-lisp :java))
>
(Continue reading)

Alan Ruttenberg | 15 Aug 07:59

Re: some pathname wildcard code

speaking of pathnames - anyone run into the tendency of logical  
pathnames to lose their case?
-Alan

On Aug 15, 2008, at 1:46 AM, Erik Huelsmann wrote:

> On Thu, Aug 14, 2008 at 7:55 PM, Russell McManus
> <russell_mcmanus <at> yahoo.com> wrote:
>>
>> Something like the following might be useful in implementing support
>> for wild pathnames in DIRECTORY in abcl.
>>
>> One issue that I aware of but did not address is that I used
>> STRING-EQUAL in a couple of places that might be incorrect on Windows
>> and/or OSX.
>
> Hi!
>
> I'm about to step onto a flight, but let me take a minute to say
> thanks for the contribution! When having a cursory look at
> pathnames.lisp, I think to see some of the code that you wrote down
> here too. I didn't look at your code long enough though to find out
> whether it solves the "wild parents" problem: the fact that the path
> we're looking at can't itself contain wildcard patterns (or at least,
> that's the bug).
>
> Bye,
>
> Erik.
>
(Continue reading)

Erik Huelsmann | 5 Nov 22:51

Re: some pathname wildcard code

No, but I didn't use them very much yet. Do you have a reproduction
recipe? I'll gladly file a ticket if there's reason to.

Bye,

Erik.

On Fri, Aug 15, 2008 at 6:59 AM, Alan Ruttenberg
<alanruttenberg <at> gmail.com> wrote:
> speaking of pathnames - anyone run into the tendency of logical pathnames to
> lose their case?
> -Alan
>
> On Aug 15, 2008, at 1:46 AM, Erik Huelsmann wrote:
>
>> On Thu, Aug 14, 2008 at 7:55 PM, Russell McManus
>> <russell_mcmanus <at> yahoo.com> wrote:
>>>
>>> Something like the following might be useful in implementing support
>>> for wild pathnames in DIRECTORY in abcl.
>>>
>>> One issue that I aware of but did not address is that I used
>>> STRING-EQUAL in a couple of places that might be incorrect on Windows
>>> and/or OSX.
>>
>> Hi!
>>
>> I'm about to step onto a flight, but let me take a minute to say
>> thanks for the contribution! When having a cursory look at
>> pathnames.lisp, I think to see some of the code that you wrote down
(Continue reading)

Russell McManus | 15 Aug 15:52
Favicon

Re: some pathname wildcard code

The code I wrote works ok at least for the case that I posted in my original report.
You could just give it a try!  I promise it will not erase your hard disk. ;-)

I did not intend to fully replace the code in pathnames.lisp, but rather to illustrate one approach
to a fuller fix.  I am not sure that I understand the overall structure of abcl to replace system
level code.

-russ

----- Original Message ----
> From: Erik Huelsmann <ehuels <at> gmail.com>
> To: Russell McManus <russell_mcmanus <at> yahoo.com>
> Cc: armedbear-j-devel <at> lists.sourceforge.net
> Sent: Friday, August 15, 2008 12:46:25 AM
> Subject: Re: [j-devel] some pathname wildcard code
> 
> On Thu, Aug 14, 2008 at 7:55 PM, Russell McManus
> wrote:
> >
> > Something like the following might be useful in implementing support
> > for wild pathnames in DIRECTORY in abcl.
> >
> > One issue that I aware of but did not address is that I used
> > STRING-EQUAL in a couple of places that might be incorrect on Windows
> > and/or OSX.
> 
> Hi!
> 
> I'm about to step onto a flight, but let me take a minute to say
> thanks for the contribution! When having a cursory look at
(Continue reading)


Gmane