summaryrefslogtreecommitdiffstats
path: root/Include/fileutils.h
Commit message (Collapse)AuthorAgeFilesLines
* Issue #23524: Replace _PyVerify_fd function with calls to ↵Steve Dower2015-04-121-1/+1
| | | | _set_thread_local_invalid_parameter_handler.
* Issue #23836: Add _Py_write_noraise() functionVictor Stinner2015-04-011-0/+5
| | | | | Helper to write() which retries write() if it is interrupted by a signal (fails with EINTR).
* Issue #23752: _Py_fstat() is now responsible to raise the Python exceptionVictor Stinner2015-03-301-2/+6
| | | | Add _Py_fstat_noraise() function when a Python exception is not welcome.
* Issue #23753: Move _Py_wstat() from Python/fileutils.c to Modules/getpath.cVictor Stinner2015-03-241-4/+0
| | | | | | | I expected more users of _Py_wstat(), but in practice it's only used by Modules/getpath.c. Move the function because it's not needed on Windows. Windows uses PC/getpathp.c which uses the Win32 API (ex: GetFileAttributesW()) not the POSIX API.
* Issue #23753: Python doesn't support anymore platforms without stat() orVictor Stinner2015-03-241-6/+0
| | | | | | | fstat(), these functions are always required. Remove HAVE_STAT and HAVE_FSTAT defines, and stop supporting DONT_HAVE_STAT and DONT_HAVE_FSTAT.
* Issue #23708: Add _Py_read() and _Py_write() functions to factorize code handleVictor Stinner2015-03-191-0/+10
| | | | | | | | EINTR error and special cases for Windows. These functions now truncate the length to PY_SSIZE_T_MAX to have a portable and reliable behaviour. For example, read() result is undefined if counter is greater than PY_SSIZE_T_MAX on Linux.
* Issue #23694: Enhance _Py_open(), it now raises exceptionsVictor Stinner2015-03-171-0/+4
| | | | | | | | * _Py_open() now raises exceptions on error. If open() fails, it raises an OSError with the filename. * _Py_open() now releases the GIL while calling open() * Add _Py_open_noraise() when _Py_open() cannot be used because the GIL is not held
* Issue #23524: Replace _PyVerify_fd function with calling ↵Steve Dower2015-03-061-0/+12
| | | | _set_thread_local_invalid_parameter_handler on every thread.
* Issue #23152: Move declarations back to posixmodule.c.Serhiy Storchaka2015-02-221-4/+0
| | | | | | | Declarations of Windows-specific auxilary functions need Windows types from windows.h. Instead of including windows.h in Python.h and making it available to all Windows users, it is simpler and safer just move declarations to the single file that needs them.
* Issue #23152: Move declaration into a header and exclude from stable API.Serhiy Storchaka2015-02-221-0/+6
|
* Issue #23152: Implement _Py_fstat() to support files larger than 2 GB on ↵Steve Dower2015-02-211-1/+30
| | | | | | Windows. fstat() may fail with EOVERFLOW on files larger than 2 GB because the file size type is an signed 32-bit integer.
* Issue #18395: Rename ``_Py_char2wchar()`` to :c:func:`Py_DecodeLocale`, renameVictor Stinner2014-08-011-2/+2
| | | | | ``_Py_wchar2char()`` to :c:func:`Py_EncodeLocale`, and document these functions.
* Issue #22054: Add os.get_blocking() and os.set_blocking() functions to get andVictor Stinner2014-07-291-1/+8
| | | | | set the blocking mode of a file descriptor (False if the O_NONBLOCK flag is set, True otherwise). These functions are not available on Windows.
* Issue #19526: Exclude all new API from the stable ABI.Martin v. Löwis2014-01-031-0/+4
|
* Issue #18571: Implementation of the PEP 446: file descriptors and file handlesVictor Stinner2013-08-271-0/+15
| | | | | are now created non-inheritable; add functions os.get/set_inheritable(), os.get/set_handle_inheritable() and socket.socket.get/set_inheritable().
* Issue #14153 Create _Py_device_encoding() to prevent _io from having to importBrett Cannon2012-02-291-0/+2
| | | | the os module.
* PyUnicode_EncodeFS() raises an exception if _Py_wchar2char() failsVictor Stinner2010-11-081-1/+2
| | | | | | * Add error_pos optional argument to _Py_wchar2char() * PyUnicode_EncodeFS() raises a UnicodeEncodeError or MemoryError if _Py_wchar2char() fails
* Add an optional size argument to _Py_char2wchar()Victor Stinner2010-10-161-1/+2
| | | | | | _Py_char2wchar() callers usually need the result size in characters. Since it's trivial to compute it in _Py_char2wchar() (O(1) whereas wcslen() is O(n)), add an option to get it.
* Mark _Py_char2wchar() input argument as constantVictor Stinner2010-10-151-1/+1
|
* _Py_wrealpath() requires the size of the output bufferVictor Stinner2010-10-071-1/+2
|
* _Py_stat() and _Py_fopen(): avoid PyUnicode_AsWideCharString() on WindowsVictor Stinner2010-10-071-2/+2
| | | | | On Windows, Py_UNICODE is wchar_t, so we can avoid the expensive Py_UNICODE* => wchar_t* conversion.
* Fix fileutils for WindowsVictor Stinner2010-10-071-1/+1
| | | | | | * Don't define _Py_wstat() on Windows, Windows has its own _wstat() function with a different API (the stat buffer has another type) * Include windows.h
* Create fileutils.c/.hVictor Stinner2010-10-071-0/+55
* _Py_fopen() and _Py_stat() come from Python/import.c * (_Py)_wrealpath() comes from Python/sysmodule.c * _Py_char2wchar(), _Py_wchar2char() and _Py_wfopen() come from Modules/main.c * (_Py)_wstat(), (_Py)_wgetcwd(), _Py_wreadlink() come from Modules/getpath.c