-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Thiago Brito
committed
Mar 20, 2020
1 parent
8e82cda
commit ff7f33d
Showing
4 changed files
with
162 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import os | ||
import stat | ||
|
||
class FileInfoMixin: | ||
|
||
@property | ||
def size(self): | ||
return os.stat(self.path).st_size | ||
|
||
@property | ||
def inode(self): | ||
return os.stat(self.path).st_ino | ||
|
||
@property | ||
def mode(self): | ||
return stat.filemode(os.stat(self.path).st_mode) | ||
|
||
@property | ||
def change_at(self): | ||
return os.stat(self.path).st_ctime | ||
|
||
@property | ||
def modify_at(self): | ||
return os.stat(self.path).st_mtime | ||
|
||
@property | ||
def access_at(self): | ||
return os.stat(self.path).st_atime | ||
|
||
@property | ||
def uid(self): | ||
return os.stat(self.path).st_uid | ||
|
||
@property | ||
def gid(self): | ||
return os.stat(self.path).st_gid | ||
|
||
@property | ||
def dev(self): | ||
return os.stat(self.path).st_dev | ||
|
||
@property | ||
def links(self): | ||
return os.stat(self.path).st_nlink |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters