summaryrefslogtreecommitdiffstats
path: root/Modules/_fileio.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove a bogus comment based on the code above.Neal Norwitz2007-08-161-2/+0
|
* Cleanup a little.Neal Norwitz2007-08-121-31/+34
| | | | | | Use bit fields for flags to reduce memory usage. Return booleans where they are documented. Although a boolean for seekable seems a bit odd when it can be unknown. Add a comment about this.
* Py_ssize_t requires "n" format, this fixes most of the 64-bit only failures.Neal Norwitz2007-08-081-1/+1
|
* Merged revisions 56467-56482 via svnmerge fromMartin v. Löwis2007-07-211-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/p3yk ................ r56477 | martin.v.loewis | 2007-07-21 09:04:38 +0200 (Sa, 21 Jul 2007) | 11 lines Merged revisions 56466-56476 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r56476 | martin.v.loewis | 2007-07-21 08:55:02 +0200 (Sa, 21 Jul 2007) | 4 lines PEP 3123: Provide forward compatibility with Python 3.0, while keeping backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT. ........ ................ r56478 | martin.v.loewis | 2007-07-21 09:47:23 +0200 (Sa, 21 Jul 2007) | 2 lines PEP 3123: Use proper C inheritance for PyObject. ................ r56479 | martin.v.loewis | 2007-07-21 10:06:55 +0200 (Sa, 21 Jul 2007) | 3 lines Add longintrepr.h to Python.h, so that the compiler can see that PyFalse is really some kind of PyObject*. ................ r56480 | martin.v.loewis | 2007-07-21 10:47:18 +0200 (Sa, 21 Jul 2007) | 2 lines Qualify SHIFT, MASK, BASE. ................ r56482 | martin.v.loewis | 2007-07-21 19:10:57 +0200 (Sa, 21 Jul 2007) | 2 lines Correctly refer to _ob_next. ................
* Second part of sf# 1752225: On windows, emulate ftruncate with Win32Thomas Heller2007-07-121-4/+37
| | | | | | | | | | | api functions. Code from fileobject.c, patch by Amaury Forgeot d'Arc. This patch also changes: The return value of the native ftruncate function is checked for '!= 0' instead of '< 0' as before. fileio_seekable returns bool now instead of an int.
* First part of sf# 1752225: Support for wide filenames on Windows.Thomas Heller2007-07-121-9/+12
| | | | Patch by Amaury Forgeot d'Arc.
* 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.