summaryrefslogtreecommitdiffstats
path: root/Objects/fileobject.c
Commit message (Collapse)AuthorAgeFilesLines
* Checking in the new, improve file.writelines() code.Guido van Rossum2000-03-131-24/+78
| | | | | | This (1) avoids thread unsafety whereby another thread could zap the list while we were using it, and (2) now supports writing arbitrary sequences of strings.
* Many changes for Unicode, by Marc-Andre Lemburg.Guido van Rossum2000-03-101-1/+7
|
* Massive patch by Skip Montanaro to add ":name" to as manyGuido van Rossum2000-02-291-5/+5
| | | | PyArg_ParseTuple() format string arguments as possible.
* Patch by Mark Hammond to avoid certain header files on Windows/CE.Guido van Rossum1999-08-271-1/+10
|
* casts for picky compilers.Guido van Rossum1999-04-101-1/+1
|
* Jim Ahlstrom patch: BIGCHUNK is too large for 16-bit int.Guido van Rossum1999-01-141-1/+5
|
* Need to include <sys/types.h> for off_t.Guido van Rossum1999-01-071-0/+2
|
* Changes for long file support by Steve Clift.Guido van Rossum1999-01-061-11/+53
| | | | (This also redoes my previous patch, but better.)
* Fix two places (seek and truncate) where a cascade of PyArg_ParseGuido van Rossum1999-01-041-11/+9
| | | | | calls was used instead of a single PyArg_ParseTuple call with an optional argument.
* As noted by Per Cederqvist, new_buffersize() sometimes returns theGuido van Rossum1998-12-111-2/+11
| | | | | | | buffer increment, and sometimes the new buffer size. Make it do what its name says, and fix the one place where this matters to the caller. Also add a comment explaining why we call lseek() and then ftell().
* PyFile_FromString(): If an exception occurs, pass in the filename thatBarry Warsaw1998-07-231-1/+2
| | | | | was used so it's reflected in the IOError. Call PyErr_SetFromErrnoWithFilename().
* Ugly band-aid to work around a bug in Linux ftell().Guido van Rossum1998-05-051-1/+3
|
* Enable ftruncate() on the Mac.Guido van Rossum1998-04-281-0/+6
| | | | (Jack)
* Clear the error condition set by ftell().Guido van Rossum1998-04-271-0/+2
|
* Make new gcc -Wall happyGuido van Rossum1998-04-101-3/+6
|
* Subtle fix in the read() code which could cause a read broken up inGuido van Rossum1998-03-181-1/+1
| | | | several pieces to fail...
* When we have no setvbuf(), make the file totally unbuffered usingGuido van Rossum1998-03-061-1/+4
| | | | setbuf() if a buffer size of 0 or 1 byte is requested.
* Of course, I shouldn't have used lseek() to find out the file'sGuido van Rossum1998-03-031-6/+3
| | | | | position in new_buffersize(); the correct function to use is ftell(). Thanks to Ben Jackson.
* Check ferror(), not errno, for fread() error.Guido van Rossum1998-02-191-1/+1
|
* Fix problem discovered by Barry: if you hit ^C toGuido van Rossum1997-11-071-2/+2
| | | | | | | sys.stdin.readline(), you get a fatal error (no current thread). This is because there was a call to PyErr_CheckSignals() while there was no current thread. I wonder how many more of these we find... I bnetter go hunting for PyErr_CheckSignals() now...
* Use lseek instead of ftell; compensate by adding BUFSIZEGuido van Rossum1997-08-211-2/+6
|
* Reordered list of methods to hopefully put the most frequently usedGuido van Rossum1997-07-131-8/+10
| | | | | | ones near the front. Also added a missing "return -1" to PyFile_WriteString.
* PyFile_WriteString now returns an error indicator instead of callingGuido van Rossum1997-05-221-12/+18
| | | | PyErr_Clear().
* Fix typo in error checking spotted by Just...Guido van Rossum1997-05-221-1/+1
|
* Add optional 'sizehint' argument to readlines(). After approximatelyGuido van Rossum1997-05-101-23/+33
| | | | | | | | | | | | this many bytes have been read, readlines stops. Because of buffering, the amount of bytes read is usually at least 8K more than the hint. Also changed read() and readline() to use PyArg_ParseTuple(). (Note that the *previous* checkin also fixed error handling and narrowed the range of thread unblocking for all methods using fread().)
* Rewrite readlines() to speed it up -- about a factor of 2 on myGuido van Rossum1997-05-101-25/+89
| | | | Indigo2, reading a 9Meg file from the local disk.
* Speed up read() (i.e. read till EOF) considerably by doing a stat() toGuido van Rossum1997-05-091-15/+65
| | | | | | see if we can guess the #bytes until the end of the file. If we can't, increment the buffer size increments up to 0.5Meg to avoid realloc'ing too much.
* Fix by Mark Hammond to enable truncate() on Windows.Guido van Rossum1997-05-061-0/+6
|
* Checkin of Jack's buffer mods.Guido van Rossum1997-05-051-0/+36
| | | | Not really checked, but didn't fail any tests either...
* Quickly renamed the last directory.Guido van Rossum1997-05-021-295/+296
|
* Make gcc -Wall happy.Guido van Rossum1996-12-051-0/+4
|
* New permission notice, includes CNRI.Guido van Rossum1996-10-251-13/+20
|
* fix read(0), readline(0); make tuple for call_object argsGuido van Rossum1995-07-101-14/+17
|
* MW does not always set errno on failing fopen()Jack Jansen1995-04-231-0/+11
|
* explicitly init flags in methodlistsGuido van Rossum1995-02-191-12/+16
|
* Added 1995 to copyright message.Guido van Rossum1995-01-041-2/+2
| | | | | floatobject.c: fix hash(). methodobject.c: support METH_FREENAME flag bit.
* Lots of minor changes. Note for mappingobject.c: the hash table pointerGuido van Rossum1995-01-021-1/+49
| | | | can now be NULL.
* Merge alpha100 branch back to main trunkGuido van Rossum1994-08-011-24/+80
|
* * mpzmodule.c: removed redundant mpz_print function.Guido van Rossum1993-11-051-9/+6
| | | | | | | | | | | | | | * object.[ch], bltinmodule.c, fileobject.c: changed str() to call strobject() which calls an object's __str__ method if it has one. strobject() is also called by writeobject() when PRINT_RAW is passed. * ceval.c: rationalize code for PRINT_ITEM (no change in function!) * funcobject.c, codeobject.c: added compare and hash functionality. Functions with identical code objects and the same global dictionary are equal. Code objects are equal when their code, constants list and names list are identical (i.e. the filename and code name don't count). (hash doesn't work yet since the constants are in a list and lists can't be hashed -- suppose this should really be done with a tuple now we have resizetuple!)
* * fileobject.c (softspace): fix bug if called with NULL file.Guido van Rossum1993-11-011-1/+1
|
* * filemodule.c: added writelines() -- analogous to readlines()Guido van Rossum1993-10-251-0/+42
| | | | * import.c: fixed core dump when out-of-date .pyc file encountered (again!)
* * bltinmodule.c: removed exec() built-in function.Guido van Rossum1993-10-181-0/+10
| | | | | | | * Grammar: add exec statement; allow testlist in expr statement. * ceval.c, compile.c, opcode.h: support exec statement; avoid optimizing locals when it is used * fileobject.{c,h}: add getfilename() internal function.
* * Makefile: added all: and default: targets.Guido van Rossum1993-07-051-4/+1
| | | | | | | | | | | | * many files: made some functions static; removed "extern int errno;". * frozenmain.c: fixed bugs introduced on 24 June... * flmodule.c: remove 1.5 bw compat hacks, add new functions in 2.2a (and some old functions that were omitted). * timemodule.c: added MSDOS floatsleep version . * pgenmain.c: changed exit() to goaway() and added defn of goaway(). * intrcheck.c: add hack (to UNIX only) so interrupting 3 times will exit from a hanging program. The second interrupt prints a message explaining this to the user.
* * Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.Guido van Rossum1993-06-171-1/+1
| | | | | | | | | | Added $(SYSDEF) to its build rule in Makefile. * cgensupport.[ch], modsupport.[ch]: removed some old stuff. Also changed files that still used it... And made several things static that weren't but should have been... And other minor cleanups... * listobject.[ch]: add external interfaces {set,get}listslice * socketmodule.c: fix bugs in new send() argument parsing. * sunaudiodevmodule.c: added flush() and close().
* * Added Fixcprt.py: script to fix copyright message.Guido van Rossum1993-01-261-2/+2
| | | | | | | | | | | * various modules: added 1993 to copyright. * thread.c: added copyright notice. * ceval.c: minor change to error message for "+" * stdwinmodule.c: check for error from wfetchcolor * config.c: MS-DOS fixes (define PYTHONPATH, use DELIM, use osdefs.h) * Add declaration of inittab to import.h * sysmodule.c: added sys.builtin_module_names * xxmodule.c, xxobject.c: fix minor errors
* Added separate main program for the Mac: macmain.cGuido van Rossum1993-01-211-2/+2
| | | | | | | | | | | | | | | | | | | | | stdwinmodule.c: wsetfont can now return an error Makefile: add CL_USE and CL_LIB*S; config.c: move CL part around New things in imgfile; also in Makefile. longobject.c: fix comparison of negative long ints... [REAL BUG!] marshal.c: add dumps() and loads() to read/write strings timemodule.c: make sure there's always a floatsleep() posixmodule.c: rationalize struct returned by times() Makefile: add test target, disable imgfile by default thread.c: Improved coexistance with dl module (sjoerd) stdwinmodule.c: Change include stdwin.h if macintosh rotormodule.c: added missing last argument to RTR_?_region calls confic.c: merged with configmac.c, added 1993 to copyright message fileobject.c: int compared to NULL in writestring(); change fopenRF ifdef timemodule.c: simplify times() using mkvalue; include myselect.h earlier (for sequent). posixmodule: for sequent, include unistd.h instead of explicit extern definitions and don't define rename() Makefile: change misleading/wrong MD5 comments
* Checking in last-minute changes that are already part of release 0.9.8Guido van Rossum1993-01-101-2/+3
|
* fileobject.c: fix nasty bug; Makefile; turn on STROP and change lint flags.Guido van Rossum1992-12-221-1/+1
|
* Modified most (but not yet all) I/O to always go through sys.stdout orGuido van Rossum1992-09-251-6/+143
| | | | | | sys.stderr or sys.stdin, and to work with any object as long as it has a write() (respectively readline()) methods. Some functions that took a FILE* argument now take an object* argument.
* * Makefile: added IMGFILE; moved some stuff around.Guido van Rossum1992-09-171-19/+1
| | | | | | | | * flmodule.c: added some missing functions; changed readonly flags of some data members based upon FORMS documentation. * listobject.c: fixed int/long arg lint bug (bites PC compilers). * several: removed redundant print methods (repr is good enough). * posixmodule.c: added (still experimental) process group functions.