lua-users home
lua-l archive

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

The second argument of stats() is a stuct, which has a lot of fields to declare:

struct stat {

  dev_t st_dev; /* IDs of device on which file resides */
  ino_t st_ino; /* I-node number of file */
  mode_t st_mode; /* File type and permissions */
  nlink_t st_nlink; /* Number of (hard) links to file */
  uid_t st_uid; /* User ID of file owner */
  gid_t st_gid; /* Group ID of file owner */


What's the most easy way to declare such a struct, especially one should know the basic C type behind type such as dev_t or ino_t?
I tried the constants utility which is bundled with alien, but I guess it only works with magic number not something like dev_t
lei yang