summaryrefslogtreecommitdiffstats
path: root/Modules/_fileio.c
Commit message (Collapse)AuthorAgeFilesLines
...
* See SF# 1751801: Windows: Add the _fileio builtin module, and undefineThomas Heller2007-07-111-1/+7
| | | | HAVE_FTRUNCATE because ftruncate does not exist on Windows.
* Made test_file pass. This meant adding support for read(-1) and read()Guido van Rossum2007-07-101-7/+70
| | | | | | | | to even the most basic file object (I also added readall() which may be a better API). Also, not all the tests requiring specific failure modes could be saved. And there were the usual str/bytes issues. I made sure test_io.py still passes (io.py is now most thoroughly tested by combining test_file.py and test_io.py).
* Fix a buch of shallow test failures.Guido van Rossum2007-06-181-1/+1
| | | | | Note: in test_fileinput.py, two tests are disabled until I figure out how to replace these.
* Use O_APPEND flag instead of seeking, when appendWalter Dörwald2007-06-061-12/+5
| | | | mode is specified.
* If append mode is specified seek to the end of the file.Walter Dörwald2007-06-061-0/+12
| | | | Add a test to test_fileio.py for this.
* Remove native popen() and fdopen(), replacing them with subprocess calls.Guido van Rossum2007-05-241-0/+6
| | | | | Fix a path to an assert in fileio_read(). Some misc tweaks.
* Add functions PyUnicode_Append() and PyUnicode_AppendAndDel() that mirrorWalter Dörwald2007-05-181-2/+2
| | | | | | | | | | | | | | | PyString_Concat() and PyString_ConcatAndDel() (the name PyUnicode_Concat() was already taken). Change PyObject_Repr() to always return a unicode object. Update all repr implementations to return unicode objects. Add a function PyObject_ReprStr8() that calls PyObject_Repr() and converts the result to an 8bit string. Use PyObject_ReprStr8() where using PyObject_Repr() can't be done straightforward.
* Make a few more tests pass with the new I/O library.Guido van Rossum2007-04-121-12/+9
| | | | | | Fix the truncate() semantics -- it should not affect the current position. Switch wave.py/chunk.py to struct.unpack_from() to support bytes. Don't use writelines() on binary files (test_fileinput.py).
* truncate() returns the new size and position.Guido van Rossum2007-04-101-4/+10
| | | | | | | | write() returns the number of bytes/characters written/buffered. FileIO.close() calls self.flush(). Implement readinto() for buffered readers. Tests th check all these. Test proper behavior of __enter__/__exit__.
* Implement long positioning (Unix only, probably).Guido van Rossum2007-04-101-130/+146
| | | | Etc., etc.
* Make it possible to instantiate a _FileIO() with an integer file descriptorGuido van Rossum2007-04-081-18/+50
| | | | | instead of a filename. Add a 'closed' attribute.
* Add a missing forward declaration for PyFileIO_Type. The _fileio module now ↵Collin Winter2007-03-081-0/+2
| | | | compiles with --with-pydebug.
* Check in Daniel Stutzbach's _fileio.c and test_fileio.pyGuido van Rossum2007-03-081-0/+713
(see SF#1671314) with small tweaks. The io module now uses this instead of its own implementation of the FileIO class, if it can import _fileio.