<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.lisp.osicat.devel">
    <title>gmane.lisp.osicat.devel</title>
    <link>http://blog.gmane.org/gmane.lisp.osicat.devel</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.osicat.devel/68"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.osicat.devel/67"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.osicat.devel/66"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.osicat.devel/65"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.osicat.devel/64"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.osicat.devel/63"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.osicat.devel/62"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.osicat.devel/61"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.osicat.devel/60"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.osicat.devel/60"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.osicat.devel/60"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.osicat.devel/59"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.osicat.devel/58"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.osicat.devel/57"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.osicat.devel/56"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.osicat.devel/55"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.osicat.devel/54"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.osicat.devel/53"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.osicat.devel/52"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.osicat.devel/51"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.osicat.devel/68">
    <title>[osicat-devel] Unicode error for Clozure when callingosicat-posix:mkdir on existing directory</title>
    <link>http://permalink.gmane.org/gmane.lisp.osicat.devel/68</link>
    <description>&lt;pre&gt;I get a strange error when calling osicat-posix:mkdir on an already
existing directory in Clozure.

(osicat-posix:mkdir "/this/directory/exists/" #o777)

An error is thrown:

--------------------------------------------

#&amp;lt;error printing EEXIST #x1985838E&amp;gt;
   [Condition of type OSICAT-POSIX:EEXIST]

Restarts:
 0: [RETRY] Retry SLIME REPL evaluation request.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT-BREAK] Reset this thread
 3: [ABORT] Kill this thread

Backtrace:
  0: (OSICAT-POSIX:POSIX-ERROR 17 NIL OSICAT-POSIX:MKDIR)
  1: (CCL::CALL-CHECK-REGS OSICAT-POSIX:MKDIR #P"/home/viper/tmp/bar/" 511)
  2: (CCL::CHEAP-EVAL (OSICAT-POSIX:MKDIR (MERGE-PATHNAMES "bar/"
"/home/viper/tmp/") 511))
  3: (SWANK::EVAL-REGION "(osicat-posix:mkdir (merge-pathnames
\"bar/\" \"/home/viper/tmp/\") #o777)\n")

--------------------------------------------

Select restart 1 (abort), another error comes up:

--------------------------------------------

Illegal :UTF-8 character starting at position 0.
   [Condition of type BABEL-ENCODINGS:INVALID-UTF8-STARTER-BYTE]

Restarts:
 0: [*ABORT] Return to SLIME's top level.
 1: [ABORT-BREAK] Reset this thread
 2: [ABORT] Kill this thread

Backtrace:
  0: (BABEL-ENCODINGS::UTF-8-DECODER #&amp;lt;A Foreign Pointer
[stack-allocated] #x7F60D08&amp;gt; 0 3 "^&amp;lt; at &amp;gt;^&amp;lt; at &amp;gt;^&amp;lt; at &amp;gt;"  0)
  1: (CFFI:FOREIGN-STRING-TO-LISP #&amp;lt;A Foreign Pointer
[stack-allocated] #x7F60D08&amp;gt; :OFFSET 0 :COUNT NIL :MAX-CHARS 16777215
:ENCODING :UTF-8)
  2: (OSICAT-POSIX:STRERROR 17)
  3: ((:INTERNAL (PRINT-OBJECT (OSICAT-POSIX:POSIX-ERROR T))))
  4: (CCL::%PRINT-UNREADABLE-OBJECT #&amp;lt;EEXIST #&amp;lt;error printing
OSICAT-POSIX:EEXIST #x19797F2E&amp;gt; #&amp;lt;STRING-OUTPUT-STREAM  #x1979BB66&amp;gt; T
NIL #&amp;lt;COMPILED-LEXICAL-CLOSURE (:INTERNAL ..))
  5: (#&amp;lt;STANDARD-METHOD PRINT-OBJECT (OSICAT-POSIX:POSIX-ERROR T)&amp;gt;
#&amp;lt;EEXIST #&amp;lt;error printing OSICAT-POSIX:EEXIST #x19797F2E&amp;gt;
#&amp;lt;STRING-OUTPUT-STREAM  #x1979BB66&amp;gt;)
  6: (CCL::%CALL-NEXT-METHOD (NIL #&amp;lt;STANDARD-METHOD PRINT-OBJECT
(OSICAT-POSIX:POSIX-ERROR T)&amp;gt; . 4670269))
  7: (CCL::%%STANDARD-COMBINED-METHOD-DCODE
(#&amp;lt;CCL::STANDARD-KERNEL-METHOD PRINT-OBJECT :AROUND (T T)&amp;gt;
#&amp;lt;STANDARD-METHOD PRINT-OBJECT (OSICAT-POSIX:POSIX-ERROR T)&amp;gt;) 4670269)
  8: (NIL #&amp;lt;Unknown Arguments&amp;gt;)
  9: (CCL::WRITE-A-FROB #&amp;lt;EEXIST #&amp;lt;error printing OSICAT-POSIX:EEXIST
#x19797F2E&amp;gt; #&amp;lt;STRING-OUTPUT-STREAM  #x1979BB66&amp;gt; 536870911 NIL)
 10: (CCL::WRITE-INTERNAL #&amp;lt;STRING-OUTPUT-STREAM  #x1979BB66&amp;gt; #&amp;lt;EEXIST
#&amp;lt;error printing OSICAT-POSIX:EEXIST #x19797F2E&amp;gt; 536870911 NIL)
 11: (CCL::WRITE-1 #&amp;lt;EEXIST #&amp;lt;error printing OSICAT-POSIX:EEXIST
#x19797F2E&amp;gt; #&amp;lt;STRING-OUTPUT-STREAM  #x1979BB66&amp;gt; 536870911)
 12: (PRIN1 #&amp;lt;EEXIST #&amp;lt;error printing OSICAT-POSIX:EEXIST #x19797F2E&amp;gt;
#&amp;lt;STRING-OUTPUT-STREAM  #x1979BB66&amp;gt;)
 13: (PRIN1-TO-STRING #&amp;lt;EEXIST #&amp;lt;error printing OSICAT-POSIX:EEXIST #x19797F2E&amp;gt;)
 14: (SWANK:EVAL-FOR-EMACS (SWANK:LISTENER-EVAL "(osicat-posix:mkdir
(merge-pathnames \"bar/\" \"/home/viper/tmp/\") #o777)\n")
"COMMON-LISP-USER" 63)

--------------------------------------------

This doesn't come up in SBCL or CLISP - they both print the EEXIST
error normally.

The environment is Clozure Version 1.9-dev-r15251M  (LinuxX8632) on
SLIME on Ubuntu, both locale and ccl:*default-file-character-encoding*
are utf-8.

Vladimir

_______________________________________________
pg-cvs site list
pg-cvs&amp;lt; at &amp;gt;common-lisp.net
http://common-lisp.net/mailman/listinfo/pg-cvs

&lt;/pre&gt;</description>
    <dc:creator>Vladimir Sedach</dc:creator>
    <dc:date>2012-04-15T23:29:46</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.osicat.devel/67">
    <title>Re: [osicat-devel] walk-directory does not support unicode filename and diretoryname?</title>
    <link>http://permalink.gmane.org/gmane.lisp.osicat.devel/67</link>
    <description>&lt;pre&gt;

Sounds like a strange interaction between CCL and CFFI -- could not
reproduce on SBCL.

Can you provide a tarball that has filenames that cause you trouble?

What locale are you using?

Cheers,

 -- Nikodemus

_______________________________________________
pg-cvs site list
pg-cvs&amp;lt; at &amp;gt;common-lisp.net
http://common-lisp.net/mailman/listinfo/pg-cvs&lt;/pre&gt;</description>
    <dc:creator>Nikodemus Siivola</dc:creator>
    <dc:date>2012-03-30T14:44:37</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.osicat.devel/66">
    <title>Re: [osicat-devel] prctl() support and test-related patches</title>
    <link>http://permalink.gmane.org/gmane.lisp.osicat.devel/66</link>
    <description>&lt;pre&gt;

Thanks!


This one conflicts with the current tree, and the test breaks outside Linux.


Cherry-picked and pushed.


Cherry-picked and pushed.

Cheers,

 -- Nikodemus

_______________________________________________
pg-cvs site list
pg-cvs&amp;lt; at &amp;gt;common-lisp.net
http://common-lisp.net/mailman/listinfo/pg-cvs&lt;/pre&gt;</description>
    <dc:creator>Nikodemus Siivola</dc:creator>
    <dc:date>2012-03-30T14:40:19</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.osicat.devel/65">
    <title>Re: [osicat-devel] Patch to fix osicat on OpenBSD</title>
    <link>http://permalink.gmane.org/gmane.lisp.osicat.devel/65</link>
    <description>&lt;pre&gt;

Thank you. Pushed ... we'll see if something breaks.

(Apropos: attachments generated with "git format-patch -1" are quicker
to apply.)

Cheers,

 -- nikodemus

_______________________________________________
pg-cvs site list
pg-cvs&amp;lt; at &amp;gt;common-lisp.net
http://common-lisp.net/mailman/listinfo/pg-cvs&lt;/pre&gt;</description>
    <dc:creator>Nikodemus Siivola</dc:creator>
    <dc:date>2012-03-30T14:22:18</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.osicat.devel/64">
    <title>Re: [osicat-devel] Fix out-getuid for Clisp</title>
    <link>http://permalink.gmane.org/gmane.lisp.osicat.devel/64</link>
    <description>&lt;pre&gt;

Pushed, thanks!

Cheers,

 -- nikodemus

_______________________________________________
pg-cvs site list
pg-cvs&amp;lt; at &amp;gt;common-lisp.net
http://common-lisp.net/mailman/listinfo/pg-cvs&lt;/pre&gt;</description>
    <dc:creator>Nikodemus Siivola</dc:creator>
    <dc:date>2012-03-30T14:13:11</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.osicat.devel/63">
    <title>[osicat-devel] prctl() support and test-related patches</title>
    <link>http://permalink.gmane.org/gmane.lisp.osicat.devel/63</link>
    <description>&lt;pre&gt;
Hi,

I added support for the prctl() Linux syscall to Osicat, and made two
test-related fixes.

The patches are available on my Github Osicat fork [1], more
precisely:

https://github.com/galdor/osicat/commit/736bb5c10c9c55ed76def0d58da31c1ad1eeff05
https://github.com/galdor/osicat/commit/bede645f2a3d15d825160c7518c295c95bed4271
https://github.com/galdor/osicat/commit/288dc2ee6a6861ea272ea75bb3e346cda6ca85a7

You may be interested in picking them in the official Osicat repository
:)

[1] https://github.com/galdor/osicat

Regards,

&lt;/pre&gt;</description>
    <dc:creator>Nicolas Martyanoff</dc:creator>
    <dc:date>2012-02-22T07:29:57</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.osicat.devel/62">
    <title>[osicat-devel] walk-directory does not support unicode filename anddiretoryname?</title>
    <link>http://permalink.gmane.org/gmane.lisp.osicat.devel/62</link>
    <description>&lt;pre&gt;It seems walk-directory will skip files and directories whose name is in
Unicode, such as Chinese.

Is this a bug?

Test platform: Mac OS 10.7 Lion, Clozure Common Lisp 1.8

Test Code:

(require "asdf")
(require "osicat")

(defpackage :com.losttemple.zip-db
  (:use :common-lisp :osicat))

(in-package :com.losttemple.zip-db)

(walk-directory
 (current-directory)
 #'(lambda (x) (format t "~a~%" (absolute-pathname x)))
 :test #'(lambda (x) (format t "---~a~%" (absolute-pathname x)) t)
 :directories :depth-first)

(in-package :common-lisp-user)
(quit)

&lt;/pre&gt;</description>
    <dc:creator>Achilles Xu</dc:creator>
    <dc:date>2012-02-06T09:22:08</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.osicat.devel/61">
    <title>[osicat-devel] Fix out-getuid for Clisp</title>
    <link>http://permalink.gmane.org/gmane.lisp.osicat.devel/61</link>
    <description>&lt;pre&gt;Clisp doesn't have (posix:getuid) function, instead it uses (posix:uid).
Here's small patch to fix it in osicat tests.

Timo

diff --git a/tests/tests.lisp b/tests/tests.lisp
index 2710a8f..7d0c399 100644
--- a/tests/tests.lisp
+++ b/tests/tests.lisp
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -59,6 +59,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 (defun our-getuid ()
   #+sbcl (sb-unix:unix-getuid)
   #+cmu (unix:unix-getuid)
-  #+clisp (posix:getuid)
+  #+clisp (posix:uid)
   #+allegro (excl.osi:getuid)
   #-(or sbcl cmu clisp allegro) 0) ; A sane enough default for testing?

_______________________________________________
pg-cvs site list
pg-cvs&amp;lt; at &amp;gt;common-lisp.net
http://common-lisp.net/mailman/listinfo/pg-cvs

&lt;/pre&gt;</description>
    <dc:creator>Timo Myyrä</dc:creator>
    <dc:date>2012-01-12T11:20:46</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.osicat.devel/60">
    <title>[osicat-devel] Patch to fix osicat on OpenBSD</title>
    <link>http://permalink.gmane.org/gmane.lisp.osicat.devel/60</link>
    <description>&lt;pre&gt;Hi,

Here's diff to make osicat work on OpenBSD.

OpenBSD doesn't define blksize_t and blkcnt_t so define them as
'long'. Not sure if this is correct but seems to work.
Neither does OpenBSD have the timer functions so omit them on OpenBSD.
The tests need to be tweaked for OpenBSD too, its similar to darwin in
this. Testing with other BSD's would be welcome to see if it its
needed there as well.

The funcall-getpw function seems to handle return values incorrectly.
As result it would cause exception on OpenBSD with incorrect entries
and not nil value as expected. The fix below works on OpenBSD but
could use some testing on other platforms as well.

Hopefully gmail won't break the diff.

Timo


diff --git a/posix/basic-unixint.lisp b/posix/basic-unixint.lisp
index 3ee3710..88371ae 100644
--- a/posix/basic-unixint.lisp
+++ b/posix/basic-unixint.lisp
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -286,12 +286,18 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 (ctype dev "dev_t")
 (ctype ino "ino_t")

-#-windows
+#-(or windows openbsd)
 (progn
   (ctype nlink "nlink_t")
   (ctype blksize "blksize_t")
   (ctype blkcnt "blkcnt_t"))

+#+openbsd
+(progn
+  (ctype nlink "nlink_t")
+  (ctype blksize "long")
+  (ctype blkcnt "long"))
+
 (cstruct stat "struct stat"
   (dev     "st_dev"     :type #-mips dev #+mips :unsigned-long)
   (ino     "st_ino"     :type ino)
diff --git a/posix/unix.lisp b/posix/unix.lisp
index 702d32d..f65ff55 100644
--- a/posix/unix.lisp
+++ b/posix/unix.lisp
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -394,8 +394,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
     (with-foreign-object (ts 'timespec)
       (with-foreign-slots ((sec nsec) ts timespec)
         (%clock-settime clock-id ts)
-        (values sec nsec))))
+        (values sec nsec)))))

+#-(or darwin openbsd)
+(progn
   (defsyscall ("timer_create" %timer-create) :int
     (clockid clockid)
     (sigevent :pointer)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -646,21 +648,22 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; than C's printf) with format string FORMAT and
arguments ARGS."
   (result  :pointer))

 (defun funcall-getpw (fn arg)
+  ;; http://pubs.opengroup.org/onlinepubs/009695399/functions/getpwnam.html
+  ;; "Applications wishing to check for error situations should set
+  ;; errno to 0 before calling getpwnam(). If getpwnam() returns null
+  ;; pointer and errno is non-zero, an error occured.
+  (set-errno 0)
   (with-foreign-objects ((pw 'passwd) (pwp :pointer))
     (with-foreign-pointer (buf 4096 bufsize)
       (with-foreign-slots ((name passwd uid gid gecos dir shell) pw passwd)
         (let ((ret (funcall fn arg pw buf bufsize pwp)))
-          ;; Darwin's getpwnam_r() is broken a returns -1 when the
-          ;; user is not found.  Not sure if it returns the error
-          ;; number as specified by posix.
-          #+darwin
-          (when (= ret -1)
-            (return-from funcall-getpw nil))
-          (if (zerop ret)
-              (if (null-pointer-p (mem-ref pwp :pointer))
-                  nil
-                  (values name passwd uid gid gecos dir shell))
-              (posix-error ret)))))))
+          (cond ((and (null-pointer-p (mem-ref pwp :pointer))
+                      (not (zerop (get-errno))))
+                 (posix-error ret))
+                ((and (null-pointer-p (mem-ref pwp :pointer))
+                      (zerop (get-errno)))
+                 nil)
+                (t (values name passwd uid gid gecos dir shell))))))))

 (defun getpwuid (uid)
   "Gets the password-entry of a user, by user id."
diff --git a/posix/unixint.lisp b/posix/unixint.lisp
index 43273c9..cee4337 100644
--- a/posix/unixint.lisp
+++ b/posix/unixint.lisp
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -105,6 +105,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   (int "sival_int" :type :int)
   (ptr "sival_ptr" :type :pointer))

+#-openbsd
 (cstruct sigevent "struct sigevent"
   (notify            "sigev_notify"            :type :int)
   (signo             "sigev_signo"             :type :int)
diff --git a/tests/posix.lisp b/tests/posix.lisp
index 32a4eef..de4f35d 100644
--- a/tests/posix.lisp
+++ b/tests/posix.lisp
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -139,9 +139,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 (define-posix-test mkdir.error.2
     (handler-case
         (nix:mkdir "/" 0)
-      (#+darwin nix:eisdir
+      (#+(or darwin openbsd) nix:eisdir
        #+windows nix:eacces
-       #-(or darwin windows) nix:eexist () 'failed))
+       #-(or darwin windows openbsd) nix:eexist () 'failed))
   failed)

 (define-eacces-test mkdir.error.3
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -189,9 +189,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 (define-posix-test rmdir.error.3
     (handler-case
         (nix:rmdir "/")
-      (#+darwin nix:eisdir
+      (#+(or darwin openbsd) nix:eisdir
        #+windows nix:eacces
-       #-(or darwin windows) nix:ebusy () 'failed))
+       #-(or darwin windows openbsd) nix:ebusy () 'failed))
   failed)

 (define-posix-test rmdir.error.4
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -206,7 +206,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
           (nix:rmdir dir)
           ;; documented by POSIX
           (not (null (member (system-error-identifier c)
-                             '(:eexist :enotempty #+darwin :enonet
+                             '(:eexist :enotempty #+(or darwin openbsd) :enonet
                                #+windows :enosr)))))))
   t)

_______________________________________________
pg-cvs site list
pg-cvs&amp;lt; at &amp;gt;common-lisp.net
http://common-lisp.net/mailman/listinfo/pg-cvs

&lt;/pre&gt;</description>
    <dc:creator>Timo Myyrä</dc:creator>
    <dc:date>2012-01-08T09:55:44</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.osicat.devel/60">
    <title>[osicat-devel] Patch to fix osicat on OpenBSD</title>
    <link>http://permalink.gmane.org/gmane.lisp.osicat.devel/60</link>
    <description>&lt;pre&gt;Hi,

Here's diff to make osicat work on OpenBSD.

OpenBSD doesn't define blksize_t and blkcnt_t so define them as
'long'. Not sure if this is correct but seems to work.
Neither does OpenBSD have the timer functions so omit them on OpenBSD.
The tests need to be tweaked for OpenBSD too, its similar to darwin in
this. Testing with other BSD's would be welcome to see if it its
needed there as well.

The funcall-getpw function seems to handle return values incorrectly.
As result it would cause exception on OpenBSD with incorrect entries
and not nil value as expected. The fix below works on OpenBSD but
could use some testing on other platforms as well.

Hopefully gmail won't break the diff.

Timo


diff --git a/posix/basic-unixint.lisp b/posix/basic-unixint.lisp
index 3ee3710..88371ae 100644
--- a/posix/basic-unixint.lisp
+++ b/posix/basic-unixint.lisp
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -286,12 +286,18 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 (ctype dev "dev_t")
 (ctype ino "ino_t")

-#-windows
+#-(or windows openbsd)
 (progn
   (ctype nlink "nlink_t")
   (ctype blksize "blksize_t")
   (ctype blkcnt "blkcnt_t"))

+#+openbsd
+(progn
+  (ctype nlink "nlink_t")
+  (ctype blksize "long")
+  (ctype blkcnt "long"))
+
 (cstruct stat "struct stat"
   (dev     "st_dev"     :type #-mips dev #+mips :unsigned-long)
   (ino     "st_ino"     :type ino)
diff --git a/posix/unix.lisp b/posix/unix.lisp
index 702d32d..f65ff55 100644
--- a/posix/unix.lisp
+++ b/posix/unix.lisp
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -394,8 +394,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
     (with-foreign-object (ts 'timespec)
       (with-foreign-slots ((sec nsec) ts timespec)
         (%clock-settime clock-id ts)
-        (values sec nsec))))
+        (values sec nsec)))))

+#-(or darwin openbsd)
+(progn
   (defsyscall ("timer_create" %timer-create) :int
     (clockid clockid)
     (sigevent :pointer)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -646,21 +648,22 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; than C's printf) with format string FORMAT and
arguments ARGS."
   (result  :pointer))

 (defun funcall-getpw (fn arg)
+  ;; http://pubs.opengroup.org/onlinepubs/009695399/functions/getpwnam.html
+  ;; "Applications wishing to check for error situations should set
+  ;; errno to 0 before calling getpwnam(). If getpwnam() returns null
+  ;; pointer and errno is non-zero, an error occured.
+  (set-errno 0)
   (with-foreign-objects ((pw 'passwd) (pwp :pointer))
     (with-foreign-pointer (buf 4096 bufsize)
       (with-foreign-slots ((name passwd uid gid gecos dir shell) pw passwd)
         (let ((ret (funcall fn arg pw buf bufsize pwp)))
-          ;; Darwin's getpwnam_r() is broken a returns -1 when the
-          ;; user is not found.  Not sure if it returns the error
-          ;; number as specified by posix.
-          #+darwin
-          (when (= ret -1)
-            (return-from funcall-getpw nil))
-          (if (zerop ret)
-              (if (null-pointer-p (mem-ref pwp :pointer))
-                  nil
-                  (values name passwd uid gid gecos dir shell))
-              (posix-error ret)))))))
+          (cond ((and (null-pointer-p (mem-ref pwp :pointer))
+                      (not (zerop (get-errno))))
+                 (posix-error ret))
+                ((and (null-pointer-p (mem-ref pwp :pointer))
+                      (zerop (get-errno)))
+                 nil)
+                (t (values name passwd uid gid gecos dir shell))))))))

 (defun getpwuid (uid)
   "Gets the password-entry of a user, by user id."
diff --git a/posix/unixint.lisp b/posix/unixint.lisp
index 43273c9..cee4337 100644
--- a/posix/unixint.lisp
+++ b/posix/unixint.lisp
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -105,6 +105,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   (int "sival_int" :type :int)
   (ptr "sival_ptr" :type :pointer))

+#-openbsd
 (cstruct sigevent "struct sigevent"
   (notify            "sigev_notify"            :type :int)
   (signo             "sigev_signo"             :type :int)
diff --git a/tests/posix.lisp b/tests/posix.lisp
index 32a4eef..de4f35d 100644
--- a/tests/posix.lisp
+++ b/tests/posix.lisp
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -139,9 +139,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 (define-posix-test mkdir.error.2
     (handler-case
         (nix:mkdir "/" 0)
-      (#+darwin nix:eisdir
+      (#+(or darwin openbsd) nix:eisdir
        #+windows nix:eacces
-       #-(or darwin windows) nix:eexist () 'failed))
+       #-(or darwin windows openbsd) nix:eexist () 'failed))
   failed)

 (define-eacces-test mkdir.error.3
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -189,9 +189,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 (define-posix-test rmdir.error.3
     (handler-case
         (nix:rmdir "/")
-      (#+darwin nix:eisdir
+      (#+(or darwin openbsd) nix:eisdir
        #+windows nix:eacces
-       #-(or darwin windows) nix:ebusy () 'failed))
+       #-(or darwin windows openbsd) nix:ebusy () 'failed))
   failed)

 (define-posix-test rmdir.error.4
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -206,7 +206,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
           (nix:rmdir dir)
           ;; documented by POSIX
           (not (null (member (system-error-identifier c)
-                             '(:eexist :enotempty #+darwin :enonet
+                             '(:eexist :enotempty #+(or darwin openbsd) :enonet
                                #+windows :enosr)))))))
   t)

_______________________________________________
pg-cvs site list
pg-cvs&amp;lt; at &amp;gt;common-lisp.net
http://common-lisp.net/mailman/listinfo/pg-cvs

&lt;/pre&gt;</description>
    <dc:creator>Timo Myyrä</dc:creator>
    <dc:date>2012-01-08T09:55:44</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.osicat.devel/60">
    <title>[osicat-devel] Patch to fix osicat on OpenBSD</title>
    <link>http://permalink.gmane.org/gmane.lisp.osicat.devel/60</link>
    <description>&lt;pre&gt;Hi,

Here's diff to make osicat work on OpenBSD.

OpenBSD doesn't define blksize_t and blkcnt_t so define them as
'long'. Not sure if this is correct but seems to work.
Neither does OpenBSD have the timer functions so omit them on OpenBSD.
The tests need to be tweaked for OpenBSD too, its similar to darwin in
this. Testing with other BSD's would be welcome to see if it its
needed there as well.

The funcall-getpw function seems to handle return values incorrectly.
As result it would cause exception on OpenBSD with incorrect entries
and not nil value as expected. The fix below works on OpenBSD but
could use some testing on other platforms as well.

Hopefully gmail won't break the diff.

Timo


diff --git a/posix/basic-unixint.lisp b/posix/basic-unixint.lisp
index 3ee3710..88371ae 100644
--- a/posix/basic-unixint.lisp
+++ b/posix/basic-unixint.lisp
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -286,12 +286,18 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 (ctype dev "dev_t")
 (ctype ino "ino_t")

-#-windows
+#-(or windows openbsd)
 (progn
   (ctype nlink "nlink_t")
   (ctype blksize "blksize_t")
   (ctype blkcnt "blkcnt_t"))

+#+openbsd
+(progn
+  (ctype nlink "nlink_t")
+  (ctype blksize "long")
+  (ctype blkcnt "long"))
+
 (cstruct stat "struct stat"
   (dev     "st_dev"     :type #-mips dev #+mips :unsigned-long)
   (ino     "st_ino"     :type ino)
diff --git a/posix/unix.lisp b/posix/unix.lisp
index 702d32d..f65ff55 100644
--- a/posix/unix.lisp
+++ b/posix/unix.lisp
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -394,8 +394,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
     (with-foreign-object (ts 'timespec)
       (with-foreign-slots ((sec nsec) ts timespec)
         (%clock-settime clock-id ts)
-        (values sec nsec))))
+        (values sec nsec)))))

+#-(or darwin openbsd)
+(progn
   (defsyscall ("timer_create" %timer-create) :int
     (clockid clockid)
     (sigevent :pointer)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -646,21 +648,22 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; than C's printf) with format string FORMAT and
arguments ARGS."
   (result  :pointer))

 (defun funcall-getpw (fn arg)
+  ;; http://pubs.opengroup.org/onlinepubs/009695399/functions/getpwnam.html
+  ;; "Applications wishing to check for error situations should set
+  ;; errno to 0 before calling getpwnam(). If getpwnam() returns null
+  ;; pointer and errno is non-zero, an error occured.
+  (set-errno 0)
   (with-foreign-objects ((pw 'passwd) (pwp :pointer))
     (with-foreign-pointer (buf 4096 bufsize)
       (with-foreign-slots ((name passwd uid gid gecos dir shell) pw passwd)
         (let ((ret (funcall fn arg pw buf bufsize pwp)))
-          ;; Darwin's getpwnam_r() is broken a returns -1 when the
-          ;; user is not found.  Not sure if it returns the error
-          ;; number as specified by posix.
-          #+darwin
-          (when (= ret -1)
-            (return-from funcall-getpw nil))
-          (if (zerop ret)
-              (if (null-pointer-p (mem-ref pwp :pointer))
-                  nil
-                  (values name passwd uid gid gecos dir shell))
-              (posix-error ret)))))))
+          (cond ((and (null-pointer-p (mem-ref pwp :pointer))
+                      (not (zerop (get-errno))))
+                 (posix-error ret))
+                ((and (null-pointer-p (mem-ref pwp :pointer))
+                      (zerop (get-errno)))
+                 nil)
+                (t (values name passwd uid gid gecos dir shell))))))))

 (defun getpwuid (uid)
   "Gets the password-entry of a user, by user id."
diff --git a/posix/unixint.lisp b/posix/unixint.lisp
index 43273c9..cee4337 100644
--- a/posix/unixint.lisp
+++ b/posix/unixint.lisp
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -105,6 +105,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   (int "sival_int" :type :int)
   (ptr "sival_ptr" :type :pointer))

+#-openbsd
 (cstruct sigevent "struct sigevent"
   (notify            "sigev_notify"            :type :int)
   (signo             "sigev_signo"             :type :int)
diff --git a/tests/posix.lisp b/tests/posix.lisp
index 32a4eef..de4f35d 100644
--- a/tests/posix.lisp
+++ b/tests/posix.lisp
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -139,9 +139,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 (define-posix-test mkdir.error.2
     (handler-case
         (nix:mkdir "/" 0)
-      (#+darwin nix:eisdir
+      (#+(or darwin openbsd) nix:eisdir
        #+windows nix:eacces
-       #-(or darwin windows) nix:eexist () 'failed))
+       #-(or darwin windows openbsd) nix:eexist () 'failed))
   failed)

 (define-eacces-test mkdir.error.3
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -189,9 +189,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 (define-posix-test rmdir.error.3
     (handler-case
         (nix:rmdir "/")
-      (#+darwin nix:eisdir
+      (#+(or darwin openbsd) nix:eisdir
        #+windows nix:eacces
-       #-(or darwin windows) nix:ebusy () 'failed))
+       #-(or darwin windows openbsd) nix:ebusy () 'failed))
   failed)

 (define-posix-test rmdir.error.4
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -206,7 +206,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
           (nix:rmdir dir)
           ;; documented by POSIX
           (not (null (member (system-error-identifier c)
-                             '(:eexist :enotempty #+darwin :enonet
+                             '(:eexist :enotempty #+(or darwin openbsd) :enonet
                                #+windows :enosr)))))))
   t)

_______________________________________________
pg-cvs site list
pg-cvs&amp;lt; at &amp;gt;common-lisp.net
http://common-lisp.net/mailman/listinfo/pg-cvs

&lt;/pre&gt;</description>
    <dc:creator>Timo Myyrä</dc:creator>
    <dc:date>2012-01-08T09:55:44</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.osicat.devel/59">
    <title>[osicat-devel] blksize_t and blkcnt_t undefined on OpenBSD</title>
    <link>http://permalink.gmane.org/gmane.lisp.osicat.devel/59</link>
    <description>&lt;pre&gt;Hi,

Osicat fails to compile on OpenBSD because of missing defines for
blksize_t and blkcnt_t.


External process exited with code 1.
Command was: "cc" "-m64"
"-I/home/zmyrgel/quicklisp/dists/quicklisp/software..." "-fPIC" "-o"
"/home/zmyrgel/.cache/common-lisp/sbcl-1.0.54.openb..."
"/home/zmyrgel/.cache/common-lisp/sbcl-1.0.54.openb..."
Output was:
/home/zmyrgel/.cache/common-lisp/sbcl-1.0.54.openbsd-bsd-x64/home/zmyrgel/quicklisp/dists/quicklisp/software/osicat-20110619-git/posix/basic-unixint.c:
In function 'main':
/home/zmyrgel/.cache/common-lisp/sbcl-1.0.54.openbsd-bsd-x64/home/zmyrgel/quicklisp/dists/quicklisp/software/osicat-20110619-git/posix/basic-unixint.c:2041:
error: 'blksize_t' undeclared (first use in this function)
/home/zmyrgel/.cache/common-lisp/sbcl-1.0.54.openbsd-bsd-x64/home/zmyrgel/quicklisp/dists/quicklisp/software/osicat-20110619-git/posix/basic-unixint.c:2041:
error: (Each undeclared identifier is reported only once
/home/zmyrgel/.cache/common-lisp/sbcl-1.0.54.openbsd-bsd-x64/home/zmyrgel/quicklisp/dists/quicklisp/software/osicat-20110619-git/posix/basic-unixint.c:2041:
error: for each function it appears in.)
/home/zmyrgel/.cache/common-lisp/sbcl-1.0.54.openbsd-bsd-x64/home/zmyrgel/quicklisp/dists/quicklisp/software/osicat-20110619-git/posix/basic-unixint.c:2053:
error: 'blkcnt_t' undeclared (first use in this function)


Timo

_______________________________________________
pg-cvs site list
pg-cvs&amp;lt; at &amp;gt;common-lisp.net
http://common-lisp.net/mailman/listinfo/pg-cvs

&lt;/pre&gt;</description>
    <dc:creator>Timo Myyrä</dc:creator>
    <dc:date>2012-01-02T12:43:39</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.osicat.devel/58">
    <title>never mind... Problem compiling osicat-posix with quicklisp on x86_64 with 32-bit lisp....</title>
    <link>http://permalink.gmane.org/gmane.lisp.osicat.devel/58</link>
    <description>&lt;pre&gt;Hi Osicat developers,

Disregard my previous note about problems compiling osicat-posix on 64-bit
for 32-bit lispworks. Thing work just fine if you install the 32-bit gcc,
and just let it happen!

Best regards,
   Peter
_______________________________________________
pg-cvs site list
pg-cvs&amp;lt; at &amp;gt;common-lisp.net
http://common-lisp.net/mailman/listinfo/pg-cvs&lt;/pre&gt;</description>
    <dc:creator>Peter Denno</dc:creator>
    <dc:date>2011-11-27T00:00:54</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.osicat.devel/57">
    <title>Problem compiling osicat-posix with quicklisp on x86_64with 32-bit lispworks</title>
    <link>http://permalink.gmane.org/gmane.lisp.osicat.devel/57</link>
    <description>&lt;pre&gt;Hi,

I ran into a problem compiling osicat-posix under the environment described
in the subject line. What I get:

[package osicat-posix]; /usr/bin/cc -m32
-I/home/pdenno/quicklisp/dists/quicklisp/software/cffi_0.10.6/ -fPIC -o
/home/pdenno/.cache/common-lisp/lw-6.0.1-linux-x86/home/pdenno/quicklisp/dists/quicklisp/software/osicat-20110619-git/posix/basic-unixint
/home/pdenno/.cache/common-lisp/lw-6.0.1-linux-x86/home/pdenno/quicklisp/dists/quicklisp/software/osicat-20110619-git/posix/basic-unixint.c

External process exited with code 1.
Command was: "/usr/bin/cc" "-m32"
"-I/home/pdenno/quicklisp/dists/quicklisp/software/..." "-fPIC" "-o"
"/home/pdenno/.cache/common-lisp/lw-6.0.1-linux-x86..."
"/home/pdenno/.cache/common-lisp/lw-6.0.1-linux-x86..."
Output was:
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld:
skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.3/libgcc.a when
searching for -lgcc
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld:
cannot find -lgcc
collect2: ld returned 1 exit status

I thought the -m32 a bit suspicious. Perhaps this is a cffi problem? I get
CL-USER&amp;gt;  cffi-grovel::*cpu-word-size-flags*
("-m32")

... which seems odd.

Osicat, and everything else compiles fine on sbcl.

Best regards,
  Peter
_______________________________________________
pg-cvs site list
pg-cvs&amp;lt; at &amp;gt;common-lisp.net
http://common-lisp.net/mailman/listinfo/pg-cvs&lt;/pre&gt;</description>
    <dc:creator>Peter Denno</dc:creator>
    <dc:date>2011-11-26T22:49:56</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.osicat.devel/56">
    <title>Re: open-temporary-file</title>
    <link>http://permalink.gmane.org/gmane.lisp.osicat.devel/56</link>
    <description>&lt;pre&gt;To answer my own question: This does not seem to be reasonable since

  [..] The file itself is unlinked once it has been opened. [..]

according to the documentation of `open-temporary-file`.


Regards,

Elias Pipping


_______________________________________________
pg-cvs site list
pg-cvs&amp;lt; at &amp;gt;common-lisp.net
http://common-lisp.net/mailman/listinfo/pg-cvs

&lt;/pre&gt;</description>
    <dc:creator>Elias Pipping</dc:creator>
    <dc:date>2011-09-21T00:17:42</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.osicat.devel/55">
    <title>open-temporary-file</title>
    <link>http://permalink.gmane.org/gmane.lisp.osicat.devel/55</link>
    <description>&lt;pre&gt;Hello,

the function `open-temporary-file` currently returns a stream and
nothing else. Consequently, `with-temporary-file` only exposes a
stream to its body. From my understanding it is (intentionally,
because streams are an abstraction) not possible to tell what the name
of the corresponding temporary file is just by that.

Could open-temporary-file be made to return the name of that file as
well?

I'd like to be able to write code like the following

(osicat:with-temporary-file (stream filename)
  (format stream "some content")
  (= 0 (sb-ext:process-exit-code (sb-ext:run-program "./test.sh" (list filename)))))

In other words, I'd like to pass strings in the form of (temporary)
files to a script/program that reads from the file whose name it is
passed and use `with-temporary-file` for that. Is that reasonable?


Best regards,

Elias Pipping


_______________________________________________
pg-cvs site list
pg-cvs&amp;lt; at &amp;gt;common-lisp.net
http://common-lisp.net/mailman/listinfo/pg-cvs

&lt;/pre&gt;</description>
    <dc:creator>Elias Pipping</dc:creator>
    <dc:date>2011-09-19T16:40:01</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.osicat.devel/54">
    <title>Re: osicat dotted-namestrings and absolute-pathname interaction around directory iterators</title>
    <link>http://permalink.gmane.org/gmane.lisp.osicat.devel/54</link>
    <description>&lt;pre&gt;

I think I agree. I'll need to think on this -- and the split in
responsibility between the host lisp and CL some more, though.


No, please. Don't assume that. See the docstring:

 Returns a fresh list of pathnames corresponding to all files
 within the directory named by the non-wild pathname designator
 PATHSPEC.
 If BARE-PATHNAMES is non-NIL only the files's bare pathnames are returned
 (with an empty directory component), otherwise the files' pathnames are
 merged with PATHSPEC.

Nothing about ABSOLUTE-PATHNAME there.


This is not an unreasonable thing to want, but wrong for "." given
LIST-DIRECTORY's contract.

One of the key features of LIST-DIRECTORY is that if you feed it a
relative pathname, you get a list of relative pathnames back.

Changing that as a default is not acceptable.

You have to remember that we're talking about _lisp_ pathnames and
namestrings here, not POSIX ones -- so meaning of "." is
implementation dependent to a frightening degree.

/Practically/ at the end of the day, it mostly means same as POSIX .
but before the final syscall is done implementations are allowed to
parse the namestring "." in myriad different ways, as long as it
unparses back to the same string.

It might be reasonable for ABSOLUTE-PATHNAME to treat "." and ".."
specially. Not sure -- but I'm quite hesitant to do that and rather
leave the details to implementation's MERGE-PATHNAMES logic.

(In case of SBCL, I think it should treat those a bit more specially
than it does right now.)

To get what you want, you should do:

(osicat:list-directory (osicat:absolute-pathname *default-pathname-defaults*))

or -- somewhat less portable, but shorter:

(osicat:list-directory (osicat:absolute-pathname ""))


No such guarantee, sorry.

What's portable about LIST-DIRECTORY is the way it gets the contents
of a directory: different implementations are annoyingly different
when it comes to constructing a wild pathname for DIRECTORY that gets
all files and subdirectories. With LIST-DIRECTORY you know what you
get, everywhere.

What's unportable about LIST-DIRECTORY is the canonicalization done by
MERGE-PATHNAMES of the host Lisp.


ANSI CL.

Cheers,

 -- Nikodemus

_______________________________________________
pg-cvs site list
pg-cvs&amp;lt; at &amp;gt;common-lisp.net
http://common-lisp.net/mailman/listinfo/pg-cvs&lt;/pre&gt;</description>
    <dc:creator>Nikodemus Siivola</dc:creator>
    <dc:date>2011-08-22T16:02:50</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.osicat.devel/53">
    <title>Re: osicat dotted-namestrings and absolute-pathname interaction around directory iterators</title>
    <link>http://permalink.gmane.org/gmane.lisp.osicat.devel/53</link>
    <description>&lt;pre&gt;On Thu, Aug 18, 2011 at 2:47 AM, Nikodemus Siivola
&amp;lt;nikodemus&amp;lt; at &amp;gt;random-state.net&amp;gt; wrote:

Great! I apologize if my previous communication was opaque.


I'm not clear on this. What is meant by:

"is consistent with the way other directory name designators are dealt
 with"

Is the referenced consistency w/r/t Osicat's dealings or CL's
dealings?


Maybe, but these also seem braindamaged:

 (osicat:absolute-pathname ".")
 ;=&amp;gt; #P"/home/bubba/quux/."

 (osicat:absolute-pathname "..")
 ;=&amp;gt; #P"/home/bubba/quux/.."

Whereas the equivalent of SBCL's CL pathname logic does not:

(truename (make-pathname :directory (pathname-directory ".")
                         :defaults *default-pathname-defaults*))
;=&amp;gt; #P"/home/bubba/quux/"

(truename (make-pathname :directory '(:RELATIVE :UP)
                         :defaults *default-pathname-defaults*))
;=&amp;gt; #P"/home/bubba/"


I will answer your question with the proviso that I am currently given
to believe that the return value of OSICAT:LIST-DIRECTORY is
predicated upon the return value of OSICAT:ABSOLUTE-PATHNAME and that
it is the nuanced manner with which OSICAT:LIST-DIRECTORY interacts
with OSICAT:ABSOLUTE-PATHNAME which is objectionable:

Assuming current directory is "/home/bubba/quux/" and that the
following is true:

(equal (osicat:current-directory) *default-pathname-defaults*)
;=&amp;gt; t

For (osicat:list-directory ".") I would like to see:

(osicat:list-directory #P".")
;=&amp;gt; (#P"/home/bubba/quux/foo.txt")

I find this to be more in keeping with the following equivalent
invocation of COMMON-LISP:DIRECTORY, e.g.:

(directory (make-pathname :name :wild
                          :type :wild
                          :defaults (osicat:current-directory)))
;=&amp;gt; (#P"/home/bubba/quux/foo.txt")

Likewise, for (osicat:list-directory #P"./") I would like to see:
(osicat:list-directory #P"./")
;=&amp;gt; (#P"./foo.txt")

IOW, when the user expliclitly provides the trailing #\/ (solidus)
then return a list of relative pathnames, else return a list of
pathnames fully resolved to current directory.

To have surety that Osicat resolves the pathname designator "."
consistently at all levels of its API and does so in a maner most
consistent with CL handling of pathnames w/ specific regards to
*default-pathname-defaults*.

In my mind, if Osicat allows "." as a designator for a pathname,
and if "."  _always_ resolves to the directory that is current
(whether value of "current directory" is OSICAT:CURRENT-DIRECTORY
or *DEFAULT-PATHNAME-DEFAULTS*), then its return value should be
treated equivalently to CL's *default-pathname-defaults* e.g. from
the Spec for *d-p-d*:

 ,----
 | a pathname, used as the default whenever a function needs a default
 | pathname and one is not supplied.
 `----

  The general use case is therefor to have "." and ".." be fully
  resolved to an absolute pathname.

  And more generally that "." returned as an absolute pathname in the
  same manner as getcwd(3).


Which standard, POSIX or ANSI-CL?

Thanks again for taking the time to answer my questions.

_______________________________________________
pg-cvs site list
pg-cvs&amp;lt; at &amp;gt;common-lisp.net
http://common-lisp.net/mailman/listinfo/pg-cvs

&lt;/pre&gt;</description>
    <dc:creator>MON KEY</dc:creator>
    <dc:date>2011-08-21T22:44:31</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.osicat.devel/52">
    <title>Re: osicat dotted-namestrings and absolute-pathname interaction around directory iterators</title>
    <link>http://permalink.gmane.org/gmane.lisp.osicat.devel/52</link>
    <description>&lt;pre&gt;

I honestly didn't understand /what/ you were finding objectionable
before. So we're making progress here...

However, I disagree with this: treating "." and "./" identically is
consistent with the way other directory name designators are dealt
with, and has more to do with the CL pathname logic (and braindamage)
than with POSIX.

Two questions:

1. Assuming current directory contains a single file "foo.txt", what
would you like (osicat:list-directory ".") and (osicat:list-directory
"./") to return?

2. What's the use-case?

Re. Osicat and POSIX:

Yep, the README is out of date. *However* Osicat is not /just/ a POSIX
API. It has two layers:

* The Osicat API in package OSICAT.

* The low-level APIs: currently OSICAT-POSIX and OSICAT-MACH. In the
future there will probably be OSICAT-WIN32 as well.

The Osicat API is not a POSIX API. It tries to find a place to stand
among the concepts shared by modern OSes and be a nice Lispy extension
to things in the standard.

Cheers,

 -- Nikodemus

Crowdfunding SBCL: http://www.indiegogo.com/SBCL-Threading-Improvements-1

_______________________________________________
pg-cvs site list
pg-cvs&amp;lt; at &amp;gt;common-lisp.net
http://common-lisp.net/mailman/listinfo/pg-cvs&lt;/pre&gt;</description>
    <dc:creator>Nikodemus Siivola</dc:creator>
    <dc:date>2011-08-18T06:47:58</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.osicat.devel/51">
    <title>Re: osicat dotted-namestrings and absolute-pathname interaction around directory iterators</title>
    <link>http://permalink.gmane.org/gmane.lisp.osicat.devel/51</link>
    <description>&lt;pre&gt;
That's how I see it



POSIX says that 3 or more "/" are to be normalized to a single one



[...]

I read all that but I still don't understand your point

&lt;/pre&gt;</description>
    <dc:creator>Stelian Ionescu</dc:creator>
    <dc:date>2011-08-17T19:04:29</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.osicat.devel/50">
    <title>Re: osicat dotted-namestrings and absolute-pathname interaction around directory iterators</title>
    <link>http://permalink.gmane.org/gmane.lisp.osicat.devel/50</link>
    <description>&lt;pre&gt;
So, are you suggestiong that osicat is intended as POSIX-style API?


Permit me to disagree.

By all means feel free to ignore my objections to Osicat's behaviour
around a corner case in differences between CL pathnames and POSIX.
However, please have the courtesy to at least consider that my
citation of section 4.12 IEEE Std 1003.1-2008 was not without reason
and was in fact an attempt to illustrate reasonably that POSIX 2008
_does_ have some fairly clear stipulations about the syntax for
pathnames around a file and a directory not always being the same.

POSIX prescribes certain syntax as denoting a "special filename":

 "."    (dot)
 ".."   (dot-dot)
 "/"    (&amp;lt;slash&amp;gt;)
 "//"   (&amp;lt;slash&amp;gt; &amp;lt;slash&amp;gt;)
 "///*" (&amp;lt;slash&amp;gt; &amp;lt;slash&amp;gt; &amp;lt;slash&amp;gt;*)


FFR following are what i believe to be relevant sections of POSIX-2008:

,----
| 3.266 Pathname
|
| A character string that is used to identify a file. In the context of
| POSIX.1-2008, a pathname may be limited to {PATH_MAX} bytes, including
| the terminating null byte. It has an optional beginning &amp;lt;slash&amp;gt;,
| followed by zero or more filenames separated by &amp;lt;slash&amp;gt; characters. A
| pathname may optionally contain one or more trailing &amp;lt;slash&amp;gt;
| characters. Multiple successive &amp;lt;slash&amp;gt; characters are considered to
| be the same as one &amp;lt;slash&amp;gt;, except for the case of exactly two leading
| &amp;lt;slash&amp;gt; characters.
|
| Note:
|     Pathname Resolution is defined in detail in Pathname Resolution .
|
| { ... elided ... }
|
| 3.268 Path Prefix
|
| The part of a pathname up to, but not including, the last component
| and any trailing &amp;lt;slash&amp;gt; characters, unless the pathname consists
| entirely of &amp;lt;slash&amp;gt; characters, in which case the path prefix is '/'
| for a pathname containing either a single &amp;lt;slash&amp;gt; or three or more
| &amp;lt;slash&amp;gt; characters, and '//' for the pathname //. The path prefix of a
| pathname containing no &amp;lt;slash&amp;gt; characters is empty, but is treated as
| referring to the current working directory.
|
| Note: The term is used both in the sense of identifying part of a
|     pathname that forms the prefix and of joining a non-empty path
|     prefix to a filename to form a pathname. In the latter case, the
|     path prefix need not have a trailing &amp;lt;slash&amp;gt; (in which case the
|     joining is done with a &amp;lt;slash&amp;gt; character).
`----

,----
|
| 4.12 Pathname Resolution
|  {...}
|
| The special filename dot shall refer to the directory specified by
| its predecessor. The special filename dot-dot shall refer to the
| parent directory of its predecessor directory. As a special case, in
| the root directory, dot-dot may refer to the root directory itself.
|
| The Open Group Base Specifications Issue 7 IEEE Std 1003.1-2008
|
`---- :SOURCE (URL `http://pubs.opengroup.org/onlinepubs/9699919799/')

--
/s_P\

_______________________________________________
pg-cvs site list
pg-cvs&amp;lt; at &amp;gt;common-lisp.net
http://common-lisp.net/mailman/listinfo/pg-cvs

&lt;/pre&gt;</description>
    <dc:creator>MON KEY</dc:creator>
    <dc:date>2011-08-17T18:39:29</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.lisp.osicat.devel">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.lisp.osicat.devel</link>
  </textinput>
</rdf:RDF>

