Returns file statistics for a given path.
(self, filename)
| 208 | os.makedirs(path, exist_ok=True) |
| 209 | |
| 210 | def stat(self, filename): |
| 211 | """Returns file statistics for a given path.""" |
| 212 | # NOTE: Size of the file is given by .st_size as returned from |
| 213 | # os.stat(), but we convert to .length |
| 214 | try: |
| 215 | file_length = os.stat(compat.as_bytes(filename)).st_size |
| 216 | except OSError: |
| 217 | raise errors.NotFoundError(None, None, "Could not find file") |
| 218 | return StatData(file_length) |
| 219 | |
| 220 | |
| 221 | class S3FileSystem: |