lua-users home
lua-l archive

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


	Hi Jerome

On Wed, 23 May 2007, Jerome Vuarand wrote:
> > lfs.linkattributes("link", "mode") --> "link"
> > lfs.attributes("link", "mode") --> "file"
> Is it not possible to add a new attribute to the attributes table ? This
> approach wouldn't break existing apps. Something like:
> 
> lfs.attributes("normalfile", "mode") --> "file"
> lfs.attributes("normalfile", "symlink") --> false
> lfs.attributes("linkedfile", "mode") --> "file"
> lfs.attributes("linkedfile", "symlink") --> true
	But what about the other information?  They are not relevant?
I am talking about:

         struct stat {
             dev_t     st_dev;     /* ID of device containing file */
             ino_t     st_ino;     /* inode number */
             mode_t    st_mode;    /* protection */
             nlink_t   st_nlink;   /* number of hard links */
             uid_t     st_uid;     /* user ID of owner */
             gid_t     st_gid;     /* group ID of owner */
             dev_t     st_rdev;    /* device ID (if special file) */
             off_t     st_size;    /* total size, in bytes */
             blksize_t st_blksize; /* blocksize for filesystem I/O */
             blkcnt_t  st_blocks;  /* number of blocks allocated */
             time_t    st_atime;   /* time of last access */
             time_t    st_mtime;   /* time of last modification */
             time_t    st_ctime;   /* time of last status change */
         };

	We were just discussing the `mode_t' field...

> "symlink" may be more appropriate than avoid confusion with hard links
> ("nlink").
	Sure!
		Tomás