Lines Matching defs:file
6 "open($module, /, file, mode=\'r\', buffering=-1, encoding=None,\n"
10 "Open file and return a stream. Raise OSError upon failure.\n"
12 "file is either a text or byte string giving the name (and the path\n"
13 "if the file isn\'t in the current working directory) of the file to\n"
14 "be opened or an integer file descriptor of the file to be\n"
15 "wrapped. (If a file descriptor is given, it is closed when the\n"
18 "mode is an optional string that specifies the mode in which the file\n"
20 "mode. Other common values are \'w\' for writing (truncating the file if\n"
21 "it already exists), \'x\' for creating and writing to a new file, and\n"
23 "append to the end of the file regardless of the current seek position).\n"
33 "\'w\' open for writing, truncating the file first\n"
34 "\'x\' create a new file and open it for writing\n"
35 "\'a\' open for writing, appending to the end of the file if it exists\n"
38 "\'+\' open a disk file for updating (reading and writing)\n"
42 "access, the mode \'w+b\' opens and truncates the file to 0 bytes, while\n"
43 "\'r+b\' opens the file without truncation. The \'x\' mode implies \'w\' and\n"
44 "raises an `FileExistsError` if the file already exists.\n"
50 "\'t\' is appended to the mode argument), the contents of the file are\n"
70 "file. This should only be used in text mode. The default encoding is\n"
100 "If closefd is False, the underlying file descriptor will be kept open\n"
101 "when the file is closed. This does not work when a file name is given\n"
105 "underlying file descriptor for the file object is then obtained by\n"
106 "calling *opener* with (*file*, *flags*). *opener* must return an open\n"
107 "file descriptor (passing os.open as *opener* results in functionality\n"
110 "open() returns a file object whose type depends on the mode, and\n"
111 "through which the standard file operations such as reading and writing\n"
112 "are performed. When open() is used to open a file in a text mode (\'w\',\n"
114 "a file in a binary mode, the returned class varies: in read binary\n"
119 "It is also possible to use a string or bytearray as a file for both\n"
120 "reading and writing. For strings StringIO can be used like a file\n"
121 "opened in a text mode, and for bytes a BytesIO can be used like a file\n"
128 _io_open_impl(PyObject *module, PyObject *file, const char *mode,
136 static const char * const _keywords[] = {"file", "mode", "buffering", "encoding", "errors", "newline", "closefd", "opener", NULL};
140 PyObject *file;
153 file = args[0];
264 return_value = _io_open_impl(module, file, mode, buffering, encoding, errors, newline, closefd, opener);
321 "Opens the provided file with the intent to import the contents.\n"