我们有以下设置:
我们在做什么:
从我看到的,mountserver上的linux stat命令在/ shared / fileserver2上查询文件时返回以下内容:
同时,当我使用连接到fileserver2的映射驱动器打开同一文件的属性时,我看到以下相同的文件:
正如你所看到的,在Windows资源pipe理器中显示的8月12日的创builddate无法使用stat命令查看
我在这里错过了什么?
Linux不存储文件创build时间。 所以,你将无法在Linux机器上查看这些信息。
这是显示inode数据结构的链接 。 你可以find:
time_t i_atime; time_t i_mtime; time_t i_ctime;
这些都不是创作时间。
文件创build时间不存储在Linux分区的任何地方,所以stat只显示在下面:
atime (access time) mtime (last modification time) ctime (last status change)
一些较新的Linux文件系统支持关于文件创build时间的信息(在它们的inode中),例如JFS,ext4或btrfs。 但传统的Unix和Linux文件系统并不支持它,所以整个工具链还没有意识到这样的function 。
因此,尽pipesmbfs / cifs可以访问这些信息,但是在stat结构中还没有地方可以报告这些信息 :
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 file system I/O */ blkcnt_t st_blocks; /* number of 512B 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 */ };