|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.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><a NAME="top" ID="top"></a> |
|
22 <h1>eric6.MicroPython.MicroPythonFileSystemUtilities</h1> |
|
23 <p> |
|
24 Module implementing some file system utility functions. |
|
25 </p> |
|
26 <h3>Global Attributes</h3> |
|
27 <table> |
|
28 <tr><td>None</td></tr> |
|
29 </table> |
|
30 <h3>Classes</h3> |
|
31 <table> |
|
32 <tr><td>None</td></tr> |
|
33 </table> |
|
34 <h3>Functions</h3> |
|
35 <table> |
|
36 <tr> |
|
37 <td><a href="#decoratedName">decoratedName</a></td> |
|
38 <td>Function to decorate the given name according to the given mode.</td> |
|
39 </tr><tr> |
|
40 <td><a href="#fstat">fstat</a></td> |
|
41 <td>Function to get the stat() of file.</td> |
|
42 </tr><tr> |
|
43 <td><a href="#isVisible">isVisible</a></td> |
|
44 <td>Function to check, if a filesystem entry is a hidden file or directory.</td> |
|
45 </tr><tr> |
|
46 <td><a href="#listdirStat">listdirStat</a></td> |
|
47 <td>Function to get a list of directory entries and associated stat() tuples.</td> |
|
48 </tr><tr> |
|
49 <td><a href="#mode2string">mode2string</a></td> |
|
50 <td>Function to convert a mode value to a string representation.</td> |
|
51 </tr><tr> |
|
52 <td><a href="#mtime2string">mtime2string</a></td> |
|
53 <td>Function to convert a time value to a string representation.</td> |
|
54 </tr> |
|
55 </table> |
|
56 <hr /><hr /> |
|
57 <a NAME="decoratedName" ID="decoratedName"></a> |
|
58 <h2>decoratedName</h2> |
|
59 <b>decoratedName</b>(<i>name, mode, isDir=False</i>) |
|
60 <p> |
|
61 Function to decorate the given name according to the given mode. |
|
62 </p><dl> |
|
63 <dt><i>name</i> (str)</dt> |
|
64 <dd> |
|
65 file or directory name |
|
66 </dd><dt><i>mode</i> (int)</dt> |
|
67 <dd> |
|
68 mode value |
|
69 </dd><dt><i>isDir</i> (bool)</dt> |
|
70 <dd> |
|
71 flag indicating that name is a directory |
|
72 </dd> |
|
73 </dl><dl> |
|
74 <dt>Returns:</dt> |
|
75 <dd> |
|
76 decorated file or directory name |
|
77 </dd> |
|
78 </dl><dl> |
|
79 <dt>Return Type:</dt> |
|
80 <dd> |
|
81 str |
|
82 </dd> |
|
83 </dl> |
|
84 <div align="right"><a href="#top">Up</a></div> |
|
85 <hr /><hr /> |
|
86 <a NAME="fstat" ID="fstat"></a> |
|
87 <h2>fstat</h2> |
|
88 <b>fstat</b>(<i>filename</i>) |
|
89 <p> |
|
90 Function to get the stat() of file. |
|
91 </p><dl> |
|
92 <dt><i>filename</i> (str)</dt> |
|
93 <dd> |
|
94 name of the file |
|
95 </dd> |
|
96 </dl><dl> |
|
97 <dt>Returns:</dt> |
|
98 <dd> |
|
99 tuple containing the stat() result |
|
100 </dd> |
|
101 </dl><dl> |
|
102 <dt>Return Type:</dt> |
|
103 <dd> |
|
104 tuple |
|
105 </dd> |
|
106 </dl> |
|
107 <div align="right"><a href="#top">Up</a></div> |
|
108 <hr /><hr /> |
|
109 <a NAME="isVisible" ID="isVisible"></a> |
|
110 <h2>isVisible</h2> |
|
111 <b>isVisible</b>(<i>name, showHidden</i>) |
|
112 <p> |
|
113 Function to check, if a filesystem entry is a hidden file or directory. |
|
114 </p><dl> |
|
115 <dt><i>name</i> (str)</dt> |
|
116 <dd> |
|
117 name to be checked |
|
118 </dd><dt><i>showHidden</i> (bool)</dt> |
|
119 <dd> |
|
120 flag indicating to show hidden files as well |
|
121 </dd> |
|
122 </dl><dl> |
|
123 <dt>Returns:</dt> |
|
124 <dd> |
|
125 flag indicating a visible filesystem entry |
|
126 </dd> |
|
127 </dl><dl> |
|
128 <dt>Return Type:</dt> |
|
129 <dd> |
|
130 bool |
|
131 </dd> |
|
132 </dl> |
|
133 <div align="right"><a href="#top">Up</a></div> |
|
134 <hr /><hr /> |
|
135 <a NAME="listdirStat" ID="listdirStat"></a> |
|
136 <h2>listdirStat</h2> |
|
137 <b>listdirStat</b>(<i>dirname, showHidden=False</i>) |
|
138 <p> |
|
139 Function to get a list of directory entries and associated stat() tuples. |
|
140 </p><dl> |
|
141 <dt><i>dirname</i> (str)</dt> |
|
142 <dd> |
|
143 name of the directory to list |
|
144 </dd><dt><i>showHidden</i> (bool)</dt> |
|
145 <dd> |
|
146 flag indicating to show hidden files as well |
|
147 </dd> |
|
148 </dl><dl> |
|
149 <dt>Returns:</dt> |
|
150 <dd> |
|
151 list of tuples containing the entry name and the associated |
|
152 stat() tuple |
|
153 </dd> |
|
154 </dl><dl> |
|
155 <dt>Return Type:</dt> |
|
156 <dd> |
|
157 list of tuple of (str, tuple) |
|
158 </dd> |
|
159 </dl> |
|
160 <div align="right"><a href="#top">Up</a></div> |
|
161 <hr /><hr /> |
|
162 <a NAME="mode2string" ID="mode2string"></a> |
|
163 <h2>mode2string</h2> |
|
164 <b>mode2string</b>(<i>mode</i>) |
|
165 <p> |
|
166 Function to convert a mode value to a string representation. |
|
167 </p><dl> |
|
168 <dt><i>mode</i> (int)</dt> |
|
169 <dd> |
|
170 mode value |
|
171 </dd> |
|
172 </dl><dl> |
|
173 <dt>Returns:</dt> |
|
174 <dd> |
|
175 string representation of the given mode value |
|
176 </dd> |
|
177 </dl><dl> |
|
178 <dt>Return Type:</dt> |
|
179 <dd> |
|
180 str |
|
181 </dd> |
|
182 </dl> |
|
183 <div align="right"><a href="#top">Up</a></div> |
|
184 <hr /><hr /> |
|
185 <a NAME="mtime2string" ID="mtime2string"></a> |
|
186 <h2>mtime2string</h2> |
|
187 <b>mtime2string</b>(<i>mtime</i>) |
|
188 <p> |
|
189 Function to convert a time value to a string representation. |
|
190 </p><dl> |
|
191 <dt><i>mtime</i> (int)</dt> |
|
192 <dd> |
|
193 time value |
|
194 </dd> |
|
195 </dl><dl> |
|
196 <dt>Returns:</dt> |
|
197 <dd> |
|
198 string representation of the given time |
|
199 </dd> |
|
200 </dl><dl> |
|
201 <dt>Return Type:</dt> |
|
202 <dd> |
|
203 str |
|
204 </dd> |
|
205 </dl> |
|
206 <div align="right"><a href="#top">Up</a></div> |
|
207 <hr /> |
|
208 </body></html> |