class FileAvoidWrite:
File-like object that buffers output and only writes if content changed.
Use this class like when writing to a file to avoid touching the original file if the content hasn't changed. This is useful in scenarios where file mtime is used to invalidate caches or trigger new behavior.
When writing to this file handle, all writes are buffered until the object is closed.
Objects can be used as context managers.
Method | __enter__ |
Undocumented |
Method | __exit__ |
Undocumented |
Method | __getattr__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | close |
Stop accepting writes and write file, if needed. |
Method | write |
Undocumented |
Instance Variable | _io |
Undocumented |
Instance Variable | _path |
Undocumented |