daokoder / dao-modules

Dao Standard Modules
http://daovm.net
12 stars 5 forks source link

on linux platform , tmp.dirs() get a file error #25

Closed electricface closed 10 years ago

electricface commented 10 years ago
(dao) tmp = fs.dir("/tmp")
= Dir[0x38615c0]
(dao) tmp.path
= /tmp
(dao) tmp.dirs()
[[Error::File]] --- File error:
Unknown system error (ffffffff)
Raised by:  invar.dirs(), from namespace "/home/g/daostudio/Dao/lib/dao/modules/os/libdao_fs.so::fs"
            ;
In code snippet:
      2 :  MOVE_PP     :     0 ,     0 ,     2 ;     1;   tmp. dirs
>>    3 :  MCALL       :     1 ,     1 ,     3 ;     1;   . dirs()
      4 :  RETURN      :     3 ,     1 ,     0 ;     1;   tmp. dirs()
Called by:  __main__(), at instruction 3 in line 1 in file "interactive codes";
(dao) 
Night-walker commented 10 years ago

Fixed. The error was actually raised because your /tmp apparently contains something which is not a regular file/dir. Now such file objects are simply skipped. If you want complete list of entries under certain path, you can use fs.ls().