[Ecls-list] bugfixes for unixfsys.d

Dustin Long dlong at stevens.edu
Mon Jul 10 07:34:01 UTC 2006


Hello all,

I've been playing around with the filesystem parts of ECL and found two 
bugs in unixfsys.d; patches for each are attached, along with the two 
combined into a single patch.

The first bug was in current_dir(). When the directory was a root (C:/ 
or D:/ etc in Windows, / in linux), current_dir() would return an extra 
slash at the end, which when passed to cl_pathname(), would return a 
pathname with (pathname-directory) => nil. This caused cl_directory() to 
return malformed objects when enumerating a root. This could possibly 
also be considered a bug in cl_pathname(); as (pathname-directory 
(pathname "c://")) => nil still. But either way, this fixes it.

The second bug was in dir_recursive(). In Windows, when using absolute 
paths, the drive letter was ignored. This meant (directory "C:/apps/") 
when run with a default path of "D:/blah/blah/" would work like 
(directory "D:/apps/").

There's also another possible problem I noticed. (directory "C:/apps/") 
returns everything in "C:/apps/" while (directory "C:/apps/*") only 
returns non-directory files. This is usable, however according to the 
Hyperspec, when (directory) is called with a pathspec containing no 
wilds, either nothing or the pathspec itself should be returned. So 
(directory "C:/apps/*") should do what (directory "C:/apps/") is doing 
now, and possibly some optional keyword could be added to (directory) in 
order to only list strict files. I could try and work on this if such 
functionality is desirable.

Dustin
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch-both
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20060710/35bcb257/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch1
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20060710/35bcb257/attachment-0001.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch2
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20060710/35bcb257/attachment-0002.ksh>


More information about the ecl-devel mailing list