You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be really useful to simulate unbuffered file access to simulate disk limits.
When opened with open(... buffering=False):
File system limits should be checked on file.write()
As there's no buffer, after an OSError on file.write(), subsiquent operations file.truncate(), file.seek(), file.close() should succeed
file.flush() should effectively be a NoOp.
I'm trying to test recovery after a write failure due to disk limits. As I've discovered elsewhere, the only way to properly recover is to use unbuffered access. For this testing it's important that my code recovers differently on different failures to write. At the moment pyfakefs doesn't support simulation of unbuffered access.
The text was updated successfully, but these errors were encountered:
I'm thinking about how to test this behavior. Are there any other cases except for failing write, where the buffer size will make a difference you know of?
This will probably take a bit, have to check the correct behavior first. The Python documentation is a bit scarce in that respect.
@couling - I added support for the buffering parameter to master. The support is not complete (text mode line buffering is not implemented), but for binary files this should work. Please check if this works for you.
It would be really useful to simulate unbuffered file access to simulate disk limits.
When opened with
open(... buffering=False)
:file.write()
file.write()
, subsiquent operationsfile.truncate()
,file.seek()
,file.close()
should succeedfile.flush()
should effectively be a NoOp.I'm trying to test recovery after a write failure due to disk limits. As I've discovered elsewhere, the only way to properly recover is to use unbuffered access. For this testing it's important that my code recovers differently on different failures to write. At the moment pyfakefs doesn't support simulation of unbuffered access.
The text was updated successfully, but these errors were encountered: