- 論壇徽章:
- 0
|
本帖最后由 shigw001 于 2010-04-06 17:59 編輯
我想判讀一個(gè)文件目錄或者文件 是不是本機(jī)本地硬盤上的文件 還是網(wǎng)絡(luò)文件(比如mount某個(gè)機(jī)器上的),
不知道有什么好的方法 請(qǐng)大家討論指教。
可是 我們目前說的都是關(guān)于mount的情況(有局限性), 如果是通過NIS訪問遠(yuǎn)程文件, 怎么去判斷呢?
perl 的stat 函數(shù):
1. 0 dev device number of filesystem
2. 1 ino inode number
3. 2 mode file mode (type and permissions)
4. 3 nlink number of (hard) links to the file
5. 4 uid numeric user ID of file's owner
6. 5 gid numeric group ID of file's owner
7. 6 rdev the device identifier (special files only)
8. 7 size total size of file, in bytes
9. 8 atime last access time in seconds since the epoch
10. 9 mtime last modify time in seconds since the epoch
11. 10 ctime inode change time in seconds since the epoch (*)
12. 11 blksize preferred block size for file system I/O
13. 12 blocks actual number of blocks allocated
里面可以得到有用信息嗎? |
|