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