equal
deleted
inserted
replaced
510 # Empty files cannot be mmapped, but mmapread should still work. Check |
510 # Empty files cannot be mmapped, but mmapread should still work. Check |
511 # if the file is empty, and if so, return an empty buffer. |
511 # if the file is empty, and if so, return an empty buffer. |
512 if os.fstat(fd).st_size == 0: |
512 if os.fstat(fd).st_size == 0: |
513 return b'' |
513 return b'' |
514 raise |
514 raise |
|
515 |
|
516 |
|
517 class uncacheable_cachestat: |
|
518 stat: Optional[os.stat_result] |
|
519 |
|
520 def __init__(self) -> None: |
|
521 self.stat = None |
|
522 |
|
523 def cacheable(self) -> bool: |
|
524 return False |
515 |
525 |
516 |
526 |
517 class fileobjectproxy: |
527 class fileobjectproxy: |
518 """A proxy around file objects that tells a watcher when events occur. |
528 """A proxy around file objects that tells a watcher when events occur. |
519 |
529 |