@@ -47,12 +47,12 @@ impl Metadata {
47
47
self . stat . st_size as u64
48
48
}
49
49
/// Return low level file type, if available
50
- pub fn file_type ( & self ) -> Option < u32 > {
51
- Some ( self . stat . st_mode as u32 & libc:: S_IFMT as u32 )
50
+ pub fn file_type ( & self ) -> Option < libc :: mode_t > {
51
+ Some ( self . stat . st_mode & libc:: S_IFMT )
52
52
}
53
53
/// Return device node, if available
54
- pub fn ino ( & self ) -> Option < u64 > {
55
- Some ( self . stat . st_ino as u64 )
54
+ pub fn ino ( & self ) -> Option < libc :: ino_t > {
55
+ Some ( self . stat . st_ino )
56
56
}
57
57
/// Return device node major of the file, if available
58
58
pub fn dev_major ( & self ) -> Option < u32 > {
@@ -77,32 +77,32 @@ impl Metadata {
77
77
}
78
78
}
79
79
/// Return preferered I/O Blocksize, if available
80
- pub fn blksize ( & self ) -> Option < u32 > {
81
- Some ( self . stat . st_blksize as u32 )
80
+ pub fn blksize ( & self ) -> Option < libc :: blksize_t > {
81
+ Some ( self . stat . st_blksize )
82
82
}
83
83
/// Return the number of 512 bytes blocks, if available
84
- pub fn blocks ( & self ) -> Option < u64 > {
85
- Some ( self . stat . st_blocks as u64 )
84
+ pub fn blocks ( & self ) -> Option < libc :: blkcnt_t > {
85
+ Some ( self . stat . st_blocks )
86
86
}
87
87
/// Returns file size (same as len() but Option), if available
88
- pub fn size ( & self ) -> Option < u64 > {
89
- Some ( self . stat . st_size as u64 )
88
+ pub fn size ( & self ) -> Option < libc :: off_t > {
89
+ Some ( self . stat . st_size )
90
90
}
91
91
/// Returns number of hard-links, if available
92
- pub fn nlink ( & self ) -> Option < u32 > {
93
- Some ( self . stat . st_nlink as u32 )
92
+ pub fn nlink ( & self ) -> Option < libc :: nlink_t > {
93
+ Some ( self . stat . st_nlink )
94
94
}
95
95
/// Returns user id, if available
96
- pub fn uid ( & self ) -> Option < u32 > {
97
- Some ( self . stat . st_uid as u32 )
96
+ pub fn uid ( & self ) -> Option < libc :: uid_t > {
97
+ Some ( self . stat . st_uid )
98
98
}
99
99
/// Returns group id, if available
100
- pub fn gid ( & self ) -> Option < u32 > {
101
- Some ( self . stat . st_gid as u32 )
100
+ pub fn gid ( & self ) -> Option < libc :: gid_t > {
101
+ Some ( self . stat . st_gid )
102
102
}
103
103
/// Returns mode bits, if available
104
- pub fn file_mode ( & self ) -> Option < u32 > {
105
- Some ( self . stat . st_mode as u32 & 0o7777 )
104
+ pub fn file_mode ( & self ) -> Option < libc :: mode_t > {
105
+ Some ( self . stat . st_mode & 0o7777 )
106
106
}
107
107
/// Returns last access time, if available
108
108
pub fn atime ( & self ) -> Option < SystemTime > {
0 commit comments