* Add README.cupsfs.md
Imported from Wiki: Initial Home page
Co-authored-by: Elan Ruusamäe <glen@delfi.ee>
* Extract cups.py to example directory
* Add python3 fixes
* Apply 2to3 fixes
* Format and re-indent to satisfy flake8
* Avoid star import as unable to detect undefined names
* Fix py3 issues in README.cups.md
* Apply spelling fixes to README.cups.md
* Cleanup un-needed trailing whitespace
* Fix > in README.cups.md
It's rendered raw, no need to escape ">"
---------
Co-authored-by: Nikolaus Rath <Nikolaus@rath.org>
I broke it with my locking fixes, apparently I only tested reading under
Python 2. (In Python 3 file.write returns the length, so I thought that
was true in Python 2 as well.) Sorry.
This changes the data type for the buffer of the read and write syscalls
from string to bytes. On Python 2, this has no effect. On Python 3, it
is a breaking change, but fixes a serious usibility bug that limits file
data to valid UTF-8 data. With these changes, files can contain arbitrary
data.
- Don't call file.flush() if file is not open for writing
(a fix for OS-es which adhere more to POSIX than Linux in this respect,
eg. *BSD).
- Do call file.flush() both from both of fsync and flush methods because data
is to be flushed out from userspace cache anyway before we can go on.