lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Tomas Guisasola Gorham wrote:
	I think Peter has summarized the options we have:

* have lfs.attributes() accept an optional argument not to follow links, which is backwards compatible, assuming no redundant arguments are passed;
  * add a function which doesn't follow links;
* perform stat() aswell as lstat() in lfs.attributes(), which means both modes can be returned.
	I am not sure what should be done in the last option.  Suppose
`lfs.attributes' performs both `stat' and `lstat'.  What will be the
result of `mode'?

Sorry for the confusion :). I meant for the last option to be compatible with duck's original request, i.e. return a table of mode strings (which could indicate `file', `directory', `link to file', `link to directory', `link to nothing', etc.). I wouldn't personally go this way because I think the user should follow links unless he/she explicitly requests not to (lstat/lattributes).

 - Peter Odding