@@ -36,22 +36,32 @@ def exists(self):
36
36
37
37
@property
38
38
def is_file (self ):
39
+ """Test if the path is a regular file"""
39
40
return self .run_test ("test -f %s" , self .path ).rc == 0
40
41
41
42
@property
42
43
def is_directory (self ):
44
+ """Test if the path exists and a directory"""
43
45
return self .run_test ("test -d %s" , self .path ).rc == 0
44
46
47
+ @property
48
+ def is_executable (self ):
49
+ """Test if the path exists and permission to execute is granted"""
50
+ return self .run_test ("test -x %s" , self .path ).rc == 0
51
+
45
52
@property
46
53
def is_pipe (self ):
54
+ """Test if the path exists and is a pipe"""
47
55
return self .run_test ("test -p %s" , self .path ).rc == 0
48
56
49
57
@property
50
58
def is_socket (self ):
59
+ """Test if the path exists and is a socket"""
51
60
return self .run_test ("test -S %s" , self .path ).rc == 0
52
61
53
62
@property
54
63
def is_symlink (self ):
64
+ """Test if the path exists and is a symbolic link"""
55
65
return self .run_test ("test -L %s" , self .path ).rc == 0
56
66
57
67
@property
@@ -86,10 +96,12 @@ def uid(self):
86
96
87
97
@property
88
98
def group (self ):
99
+ """Return file group name as string"""
89
100
raise NotImplementedError
90
101
91
102
@property
92
103
def gid (self ):
104
+ """Return file group id as integer"""
93
105
raise NotImplementedError
94
106
95
107
@property
@@ -124,10 +136,12 @@ def contains(self, pattern):
124
136
125
137
@property
126
138
def md5sum (self ):
139
+ """Compute the MD5 message digest of the file content"""
127
140
raise NotImplementedError
128
141
129
142
@property
130
143
def sha256sum (self ):
144
+ """Compute the SHA256 message digest of the file content"""
131
145
raise NotImplementedError
132
146
133
147
def _get_content (self , decode ):
0 commit comments