While trying out the word each-file, I bumped into presumably a bug in file-info ( path -- info )
Under linux, if the path is a softlink (symbolic link), path file-info symbolic-link? gives 'f' ---- and this is wrong. I looked at the implementation of file-info and saw that it calls file-status which in turn calls stat-func. The latter calls __xstat64 ---- this seems to be related to stat function. Under linux, there are two functions that returns the stat-structure. One is stat, the other lstat. If a path is a symbolic link, It is lstat that will return info about the link. ------------------------------------------- As a result of this 'bug', the following (as suggested by John the other day) could not do what is intended (to get the size of a folder). 0 a_path_to_folder t [ file-info dup symbolic-link? [ drop ] [ size>> + ] if ] each-file --HP Wei
------------------------------------------------------------------------------
_______________________________________________ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk