62 |
62 |
63 @param mode the mode to be checked (string) |
63 @param mode the mode to be checked (string) |
64 @exception IOError raised to indicate a bad file descriptor |
64 @exception IOError raised to indicate a bad file descriptor |
65 """ |
65 """ |
66 if mode != self.mode: |
66 if mode != self.mode: |
67 raise IOError('[Errno 9] Bad file descriptor') |
67 raise IOError((9, '[Errno 9] Bad file descriptor')) |
68 |
68 |
69 def __nWrite(self, n): |
69 def __nWrite(self, n): |
70 """ |
70 """ |
71 Private method to write a specific number of pending bytes. |
71 Private method to write a specific number of pending bytes. |
72 |
72 |
252 |
252 |
253 def seek(self, offset, whence=0): |
253 def seek(self, offset, whence=0): |
254 """ |
254 """ |
255 Public method to move the filepointer. |
255 Public method to move the filepointer. |
256 |
256 |
257 @param offset offset to seek for |
257 @param offset offset to move the filepointer to (integer) |
258 @param whence where to seek from |
258 @param whence position the offset relates to |
259 @exception IOError This method is not supported and always raises an |
259 @exception IOError This method is not supported and always raises an |
260 IOError. |
260 IOError. |
261 """ |
261 """ |
262 raise IOError('[Errno 29] Illegal seek') |
262 raise IOError((29, '[Errno 29] Illegal seek')) |
263 |
263 |
264 def tell(self): |
264 def tell(self): |
265 """ |
265 """ |
266 Public method to get the filepointer position. |
266 Public method to get the filepointer position. |
267 |
267 |
268 @exception IOError This method is not supported and always raises an |
268 @exception IOError This method is not supported and always raises an |
269 IOError. |
269 IOError. |
270 """ |
270 """ |
271 raise IOError('[Errno 29] Illegal seek') |
271 raise IOError((29, '[Errno 29] Illegal seek')) |
272 |
272 |
273 def truncate(self, size=-1): |
273 def truncate(self, size=-1): |
274 """ |
274 """ |
275 Public method to truncate the file. |
275 Public method to truncate the file. |
276 |
276 |
277 @param size size to truncate to (integer) |
277 @param size size to truncate to (integer) |
278 @exception IOError This method is not supported and always raises an |
278 @exception IOError This method is not supported and always raises an |
279 IOError. |
279 IOError. |
280 """ |
280 """ |
281 raise IOError('[Errno 29] Illegal seek') |
281 raise IOError((29, '[Errno 29] Illegal seek')) |
282 |
282 |
283 def writable(self): |
283 def writable(self): |
284 """ |
284 """ |
285 Public method to check, if a stream is writable. |
285 Public method to check, if a stream is writable. |
286 |
286 |