Shinmera / file-attributes

Access to common file attributes (uid, gid, permissions, ctime, mtime, atime)
https://shinmera.github.io/file-attributes
zlib License
17 stars 2 forks source link

Socket attributes are wrong on Unix #2

Open Ambrevar opened 3 years ago

Ambrevar commented 3 years ago
> (org.shirakumo.file-attributes:decode-attributes (org.shirakumo.file-attributes:attributes "/home/ambrevar/.local/share/nyxt/nyxt.socket"))
(:OTHER-READ NIL :OTHER-WRITE NIL :OTHER-EXECUTE NIL :GROUP-READ NIL
 :GROUP-WRITE NIL :GROUP-EXECUTE NIL :OWNER-READ NIL :OWNER-WRITE T
 :OWNER-EXECUTE T :STICKY NIL :SET-GROUP NIL :SET-USER NIL :FIFO NIL :DEVICE
 NIL :DIRECTORY T :NORMAL T :LINK NIL :SOCKET NIL)

I believe :directory and :normal should be NIL while :socket should be T.

Ambrevar commented 3 years ago

@shinmera Friendly ping! :) Any idea? Maybe I can give it a try and send a pull request.

Shinmera commented 3 years ago

The attributes are roughly parsed according to the mode field as specified in inode. Though I see now that the way 'link', and 'socket' are distinguished is a bit inconvenient for the way it's parsed in the library. Not sure what the best way to proceed is atm.

Either way, as you can see from the fields, a socket is a directory and "normal", so at least that indication is correct.