(self, path, size=None)
| 227 | |
| 228 | # ------------------------[ get <file> ]------------------------------ |
| 229 | def get(self, path, size=None): |
| 230 | if not size: |
| 231 | size = self.file_exists(path) |
| 232 | if size != c.NONEXISTENT: |
| 233 | # read file, one byte at a time |
| 234 | str_recv = self.cmd('/byte (0) def\n' |
| 235 | + '/infile (' + path + ') (r) file def\n' |
| 236 | + '{infile read {byte exch 0 exch put\n' |
| 237 | + '(%stdout) (w) file byte writestring}\n' |
| 238 | + '{infile closefile exit} ifelse\n' |
| 239 | + '} loop', True, True, True) |
| 240 | return (size, str_recv) |
| 241 | else: |
| 242 | print("File not found.") |
| 243 | return c.NONEXISTENT |
| 244 | |
| 245 | # ------------------------[ put <local file> ]------------------------ |
| 246 | def put(self, path, data, mode='w+'): |
nothing calls this directly
no test coverage detected