justincormack / ljsyscall

LuaJIT Unix syscall FFI

Home Page:http://www.myriabit.com/ljsyscall/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

syscall.lfs improvement

tst2005 opened this issue · comments

commented

Hello

I compared the syscall.lfs to lua file-system (lfs). Even there are not far to be equivalent
I found some differences. Some of them should be emulated or fixed.

I found one I'm not able to fix : about the device information returned by lfs.attributes.

I need it to make a find like that are able to stay on the same file system.

print( require"syscall.lfs".attributes(".","dev") )

I got a cdata (cdata<struct 1222>: 0x40e43248).

  • How to deal with it ?
  • How can I get a numerical value something to identify the device ?

Any help is welcome!

Regards

Oh, currently dev returns a type that has major, minor and dev, so print(lfs.attributes(".", "dev").dev) will work. Thats not correct for compatibility...

commented

Oh thanks!
Now I will be able to make some compat stuff...

I think this should be fixed to be compatible..

commented

Hello,
I made my possible to follow the luafilesystem behavior/API :

  1. about lfs.attributes and lfs.symlinkattributes : see #227 to have a number value in dev and rdev field and also support the table argument.
  2. fix the case when lfs.dir raise an error : see #228

Note: the 2nd PR is made on the base of the first one, I don't know if it the best way to do...