Chinaunix首页 | 论坛 | 博客
  • 博客访问: 841871
  • 博文数量: 253
  • 博客积分: 6891
  • 博客等级: 准将
  • 技术积分: 2502
  • 用 户 组: 普通用户
  • 注册时间: 2010-11-03 11:01
文章分类

全部博文(253)

文章存档

2016年(4)

2013年(3)

2012年(32)

2011年(184)

2010年(30)

分类: Python/Ruby

2011-10-14 10:57:16

  1. my($dev, $ino, $mode, $nlink, $uid, $gid, $rdev,
  2.   $size, $atime, $mtime, $ctime, $blksize, $blocks)
  3.     = stat($filename);
$dev and $ino
The device number and inode number of the file. Together they make up a “license
plate” for the file. Even if it has more than one name (hard link), the combination
of device and inode numbers should always be unique.
$mode
The set of permission bits for the file, and some other bits. If you’ve ever used the
Unix command ls -l to get a detailed (long) file listing, you’ll see that each line of
output starts with something like -rwxr-xr-x. The nine letters and hyphens of file
permissions† correspond to the nine least-significant bits of $mode, which would,
in this case, give the octal number 0755. The other bits, beyond the lowest nine,
indicate other details about the file. So, if you need to work with the mode, you’ll
generally want to use the bitwise operators covered later in this chapter.
$nlink
The number of (hard) links to the file or directory. This is the number of true names
that the item has. This number is always 2 or more for directories and (usually) 1
for files. You’ll see more about this when we talk about creating links to files in
$uid and $gid
The numeric user ID and group ID showing the file’s ownership.
$size
The size in bytes, as returned by the -s file test.
$atime, $mtime, and $ctime
The three timestamps, but here they’re represented in the system’s timestamp for-
mat: a 32-bit number telling how many seconds have passed since the Epoch, an
arbitrary starting point for measuring system time. On Unix systems and some
others, the Epoch is the beginning of 1970 at midnight Universal Time, but the
Epoch is different on some machines. There’s more information later in this chapter
on turning that timestamp number into something useful.


阅读(230) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~