From: Cyrus H. <ch...@bo...> - 2009-06-16 03:45:18
|
I'm not sure if this is the desired behavior or not: CL-USER> (directory "/tmp/foo*") (#P"/private/tmp/foo" #P"/private/tmp/foo.moose/") CL-USER> (directory "/tmp/foo.b*.*") NIL CL-USER> (directory "/tmp/foo.mo*.*") (#P"/private/tmp/foo.moose/") but it's weird that that foo.b*.* doesn't match while foo.mo*.* does (foo.bar being a file and foo.moose being a directory). I should say that this is motivated by mcclim filename completion code which can certainly be modified to suit the current behavior, but I figured i'd check to see if the current behavior is an unfortunate accident or that way by design. thanks, Cyrus Begin forwarded message: > From: "Nikodemus Siivola" <de...@us...> > Date: June 15, 2009 3:13:11 PM PDT > To: sbc...@li... > Subject: [Sbcl-commits] CVS: sbcl/tests filesys.test.sh,1.15,1.16 > > Update of /cvsroot/sbcl/sbcl/tests > In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv32137/tests > > Modified Files: > filesys.test.sh > Log Message: > 1.0.29.10: one more DIRECTORY regression > > * (DIRECTORY "X*.*") should match directories in addition to files. > > > Index: filesys.test.sh > =================================================================== > RCS file: /cvsroot/sbcl/sbcl/tests/filesys.test.sh,v > retrieving revision 1.15 > retrieving revision 1.16 > diff -u -d -r1.15 -r1.16 > --- filesys.test.sh 15 Jun 2009 10:03:55 -0000 1.15 > +++ filesys.test.sh 15 Jun 2009 22:13:08 -0000 1.16 > @@ -223,6 +223,10 @@ > (test "*/*b.*" "far/ab.txt" "far/ab.tmp") > (test "*a*/*.txt" "far/ab.txt" "qar/ac.txt") > (test "*ar/*.txt" "far/ab.txt" "qar/ac.txt") > +(test "f*.*" "far/" "foo/") > +(test "f*" "far/" "foo/") > +(test "*r" "far/" "qar/") > +(test "*r.*" "far/" "qar/") > (quit :unix-status $EXIT_LISP_WIN) > EOF > check_status_maybe_lose "DIRECTORY/PATTERNS" $? > > > ------------------------------------------------------------------------------ > Crystal Reports - New Free Runtime and 30 Day Trial > Check out the new simplified licensing option that enables unlimited > royalty-free distribution of the report engine for externally facing > server and web deployment. > http://p.sf.net/sfu/businessobjects > _______________________________________________ > Sbcl-commits mailing list > Sbc...@li... > https://lists.sourceforge.net/lists/listinfo/sbcl-commits |
From: Nikodemus S. <nik...@ra...> - 2009-06-16 08:48:45
|
2009/6/16 Cyrus Harmon <ch...@bo...>: > I'm not sure if this is the desired behavior or not: > > CL-USER> (directory "/tmp/foo*") > (#P"/private/tmp/foo" #P"/private/tmp/foo.moose/") > CL-USER> (directory "/tmp/foo.b*.*") > NIL > CL-USER> (directory "/tmp/foo.mo*.*") > (#P"/private/tmp/foo.moose/") > > but it's weird that that foo.b*.* doesn't match while foo.mo*.* does > (foo.bar being a file and foo.moose being a directory). > > I should say that this is motivated by mcclim filename completion code > which can certainly be modified to suit the current behavior, but I > figured i'd check to see if the current behavior is an unfortunate > accident or that way by design. Mostly accident. foo.b*.* does not match because it parses as CL-USER> (pathname "foo.b*.*") #P"foo.b*.*" CL-USER> (list (pathname-name *) (pathname-type *)) (#<SB-IMPL::PATTERN "foo.b" :MULTI-CHAR-WILD> :WILD) Meaning it will match foo.baz.quux, etc -- that is, the name must have a dot. This is by design, I believe. To make DIRECTORY match directories starting with x in addition to files with x*.* we dream up an additional directory component like so: (name (pathname-name pathname)) (type (pathname-type pathname)) ;; KLUDGE: We want #p"/foo" to match #p"/foo/, so cobble ;; up a directory name component from name and type -- ;; and we need to take care with * as type: we want ;; "*.*", "x*.*", and "x.*" to match directories without ;; dots in their names... (dirname (if (and (eq :wild name) (eq :wild type)) "*" (with-output-to-string (s) (when name (write-string (unparse-physical-piece name) s)) (when (and type (not (and name (eq type :wild)))) (write-string "." s) (write-string (unparse-physical-piece type) s))))) which means that the directory component for foo.mo*.* will be equivalent to foo.mo*. This an accident. Historically f*.* would find all foo/, foo.moose/, and foo.bar, but foo.m*.* and foo.b*.* would find not foo.moose/ and foo.bar, and f* would find only foo/. I'll see about getting us back to that. Cheers, -- Nikodemus |
From: Nikodemus S. <nik...@ra...> - 2009-06-16 09:42:47
|
2009/6/16 Nikodemus Siivola <nik...@ra...>: > I'll see about getting us back to that. In 1.0.29.11 -- and without the KLUDGE. Cheers, -- Nikodemus |