|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.MicroPython.MicroPythonFileSystemUtilities</title> |
|
4 <meta charset="UTF-8"> |
|
5 <style> |
|
6 body { |
|
7 background: #EDECE6; |
|
8 margin: 0em 1em 10em 1em; |
|
9 color: black; |
|
10 } |
|
11 |
|
12 h1 { color: white; background: #85774A; } |
|
13 h2 { color: white; background: #85774A; } |
|
14 h3 { color: white; background: #9D936E; } |
|
15 h4 { color: white; background: #9D936E; } |
|
16 |
|
17 a { color: #BA6D36; } |
|
18 |
|
19 </style> |
|
20 </head> |
|
21 <body> |
|
22 <a NAME="top" ID="top"></a> |
|
23 <h1>eric7.MicroPython.MicroPythonFileSystemUtilities</h1> |
|
24 |
|
25 <p> |
|
26 Module implementing some file system utility functions. |
|
27 </p> |
|
28 <h3>Global Attributes</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <h3>Classes</h3> |
|
34 |
|
35 <table> |
|
36 <tr><td>None</td></tr> |
|
37 </table> |
|
38 <h3>Functions</h3> |
|
39 |
|
40 <table> |
|
41 |
|
42 <tr> |
|
43 <td><a href="#decoratedName">decoratedName</a></td> |
|
44 <td>Function to decorate the given name according to the given mode.</td> |
|
45 </tr> |
|
46 <tr> |
|
47 <td><a href="#fstat">fstat</a></td> |
|
48 <td>Function to get the stat() of file.</td> |
|
49 </tr> |
|
50 <tr> |
|
51 <td><a href="#isVisible">isVisible</a></td> |
|
52 <td>Function to check, if a filesystem entry is a hidden file or directory.</td> |
|
53 </tr> |
|
54 <tr> |
|
55 <td><a href="#listdirStat">listdirStat</a></td> |
|
56 <td>Function to get a list of directory entries and associated stat() tuples.</td> |
|
57 </tr> |
|
58 <tr> |
|
59 <td><a href="#mode2string">mode2string</a></td> |
|
60 <td>Function to convert a mode value to a string representation.</td> |
|
61 </tr> |
|
62 <tr> |
|
63 <td><a href="#mtime2string">mtime2string</a></td> |
|
64 <td>Function to convert a time value to a string representation.</td> |
|
65 </tr> |
|
66 </table> |
|
67 <hr /> |
|
68 <hr /> |
|
69 <a NAME="decoratedName" ID="decoratedName"></a> |
|
70 <h2>decoratedName</h2> |
|
71 <b>decoratedName</b>(<i>name, mode, isDir=False</i>) |
|
72 |
|
73 <p> |
|
74 Function to decorate the given name according to the given mode. |
|
75 </p> |
|
76 <dl> |
|
77 |
|
78 <dt><i>name</i> (str)</dt> |
|
79 <dd> |
|
80 file or directory name |
|
81 </dd> |
|
82 <dt><i>mode</i> (int)</dt> |
|
83 <dd> |
|
84 mode value |
|
85 </dd> |
|
86 <dt><i>isDir</i> (bool)</dt> |
|
87 <dd> |
|
88 flag indicating that name is a directory |
|
89 </dd> |
|
90 </dl> |
|
91 <dl> |
|
92 <dt>Return:</dt> |
|
93 <dd> |
|
94 decorated file or directory name |
|
95 </dd> |
|
96 </dl> |
|
97 <dl> |
|
98 <dt>Return Type:</dt> |
|
99 <dd> |
|
100 str |
|
101 </dd> |
|
102 </dl> |
|
103 <div align="right"><a href="#top">Up</a></div> |
|
104 <hr /> |
|
105 <hr /> |
|
106 <a NAME="fstat" ID="fstat"></a> |
|
107 <h2>fstat</h2> |
|
108 <b>fstat</b>(<i>filename</i>) |
|
109 |
|
110 <p> |
|
111 Function to get the stat() of file. |
|
112 </p> |
|
113 <dl> |
|
114 |
|
115 <dt><i>filename</i> (str)</dt> |
|
116 <dd> |
|
117 name of the file |
|
118 </dd> |
|
119 </dl> |
|
120 <dl> |
|
121 <dt>Return:</dt> |
|
122 <dd> |
|
123 tuple containing the stat() result |
|
124 </dd> |
|
125 </dl> |
|
126 <dl> |
|
127 <dt>Return Type:</dt> |
|
128 <dd> |
|
129 tuple |
|
130 </dd> |
|
131 </dl> |
|
132 <div align="right"><a href="#top">Up</a></div> |
|
133 <hr /> |
|
134 <hr /> |
|
135 <a NAME="isVisible" ID="isVisible"></a> |
|
136 <h2>isVisible</h2> |
|
137 <b>isVisible</b>(<i>name, showHidden</i>) |
|
138 |
|
139 <p> |
|
140 Function to check, if a filesystem entry is a hidden file or directory. |
|
141 </p> |
|
142 <dl> |
|
143 |
|
144 <dt><i>name</i> (str)</dt> |
|
145 <dd> |
|
146 name to be checked |
|
147 </dd> |
|
148 <dt><i>showHidden</i> (bool)</dt> |
|
149 <dd> |
|
150 flag indicating to show hidden files as well |
|
151 </dd> |
|
152 </dl> |
|
153 <dl> |
|
154 <dt>Return:</dt> |
|
155 <dd> |
|
156 flag indicating a visible filesystem entry |
|
157 </dd> |
|
158 </dl> |
|
159 <dl> |
|
160 <dt>Return Type:</dt> |
|
161 <dd> |
|
162 bool |
|
163 </dd> |
|
164 </dl> |
|
165 <div align="right"><a href="#top">Up</a></div> |
|
166 <hr /> |
|
167 <hr /> |
|
168 <a NAME="listdirStat" ID="listdirStat"></a> |
|
169 <h2>listdirStat</h2> |
|
170 <b>listdirStat</b>(<i>dirname, showHidden=False</i>) |
|
171 |
|
172 <p> |
|
173 Function to get a list of directory entries and associated stat() tuples. |
|
174 </p> |
|
175 <dl> |
|
176 |
|
177 <dt><i>dirname</i> (str)</dt> |
|
178 <dd> |
|
179 name of the directory to list |
|
180 </dd> |
|
181 <dt><i>showHidden</i> (bool)</dt> |
|
182 <dd> |
|
183 flag indicating to show hidden files as well |
|
184 </dd> |
|
185 </dl> |
|
186 <dl> |
|
187 <dt>Return:</dt> |
|
188 <dd> |
|
189 list of tuples containing the entry name and the associated |
|
190 stat() tuple |
|
191 </dd> |
|
192 </dl> |
|
193 <dl> |
|
194 <dt>Return Type:</dt> |
|
195 <dd> |
|
196 list of tuple of (str, tuple) |
|
197 </dd> |
|
198 </dl> |
|
199 <div align="right"><a href="#top">Up</a></div> |
|
200 <hr /> |
|
201 <hr /> |
|
202 <a NAME="mode2string" ID="mode2string"></a> |
|
203 <h2>mode2string</h2> |
|
204 <b>mode2string</b>(<i>mode</i>) |
|
205 |
|
206 <p> |
|
207 Function to convert a mode value to a string representation. |
|
208 </p> |
|
209 <dl> |
|
210 |
|
211 <dt><i>mode</i> (int)</dt> |
|
212 <dd> |
|
213 mode value |
|
214 </dd> |
|
215 </dl> |
|
216 <dl> |
|
217 <dt>Return:</dt> |
|
218 <dd> |
|
219 string representation of the given mode value |
|
220 </dd> |
|
221 </dl> |
|
222 <dl> |
|
223 <dt>Return Type:</dt> |
|
224 <dd> |
|
225 str |
|
226 </dd> |
|
227 </dl> |
|
228 <div align="right"><a href="#top">Up</a></div> |
|
229 <hr /> |
|
230 <hr /> |
|
231 <a NAME="mtime2string" ID="mtime2string"></a> |
|
232 <h2>mtime2string</h2> |
|
233 <b>mtime2string</b>(<i>mtime</i>) |
|
234 |
|
235 <p> |
|
236 Function to convert a time value to a string representation. |
|
237 </p> |
|
238 <dl> |
|
239 |
|
240 <dt><i>mtime</i> (int)</dt> |
|
241 <dd> |
|
242 time value |
|
243 </dd> |
|
244 </dl> |
|
245 <dl> |
|
246 <dt>Return:</dt> |
|
247 <dd> |
|
248 string representation of the given time |
|
249 </dd> |
|
250 </dl> |
|
251 <dl> |
|
252 <dt>Return Type:</dt> |
|
253 <dd> |
|
254 str |
|
255 </dd> |
|
256 </dl> |
|
257 <div align="right"><a href="#top">Up</a></div> |
|
258 <hr /> |
|
259 </body></html> |