summaryrefslogtreecommitdiffstats
path: root/Objects/fileobject.c
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* * Makefile: cosmeticsGuido van Rossum1992-08-051-14/+45
| | | | | | | | | | | | | | | | | | | | | | | | | * socketmodule.c: get rid of makepair(); fix makesocketaddr to fix broken recvfrom() * socketmodule: get rid of getStrarg() * ceval.h: move eval_code() to new file eval.h, so compile.h is no longer needed. * ceval.c: move thread comments to ceval.h; always make save/restore thread functions available (for dynloaded modules) * cdmodule.c, listobject.c: don't include compile.h * flmodule.c: include ceval.h * import.c: include eval.h instead of ceval.h * cgen.py: add forground(); noport(); winopen(""); to initgl(). * bltinmodule.c, socketmodule.c, fileobject.c, posixmodule.c, selectmodule.c: adapt to threads (add BGN/END SAVE macros) * stdwinmodule.c: adapt to threads and use a special stdwin lock. * pythonmain.c: don't include getpythonpath(). * pythonrun.c: use BGN/END SAVE instead of direct calls; also more BGN/END SAVE calls etc. * thread.c: bigger stack size for sun; change exit() to _exit() * threadmodule.c: use BGN/END SAVE macros where possible * timemodule.c: adapt better to threads; use BGN/END SAVE; add longsleep internal function if BSD_TIME; cosmetics
* * Makefile adapted to changes below.Guido van Rossum1992-08-041-2/+9
| | | | | | | | | | | * split pythonmain.c in two: most stuff goes to pythonrun.c, in the library. * new optional built-in threadmodule.c, build upon Sjoerd's thread.{c,h}. * new module from Sjoerd: mmmodule.c (dynamically loaded). * new module from Sjoerd: sv (svgen.py, svmodule.c.proto). * new files thread.{c,h} (from Sjoerd). * new xxmodule.c (example only). * myselect.h: bzero -> memset * select.c: bzero -> memset; removed global variable
* fileobject.c: fix fatal bug in getline() (forgot to initialize fp now)Guido van Rossum1992-07-311-0/+1
|
* Makefile: added instann rules and $(*DEST*) defines.Guido van Rossum1992-07-061-48/+46
| | | | | fileobject.c: report more moeaningful error for I/O on closed files; user getargs() everywhere.
* Changes for new UNIX-specific built-in module 'select' and new header forGuido van Rossum1992-06-231-0/+11
| | | | | interfaces to variants of select() system call, "myselect.h". This includes adding fileno() methods to files, sockets and stdwin.
* Copyright for 1992 addedGuido van Rossum1992-04-051-1/+1
|
* Quiet lintGuido van Rossum1992-03-271-3/+2
|
* Change error handling. Call clearerr() more often.Guido van Rossum1992-03-041-15/+11
|
* Include modsupport.h for getargs().Guido van Rossum1992-01-271-0/+1
|
* Added message to EOFError.Guido van Rossum1991-12-241-1/+2
|
* Use new exceptions.Guido van Rossum1991-12-101-17/+7
|
* Call write(fileno(fp), ...) instead of fwrite for LARGE writes.Guido van Rossum1991-11-121-1/+11
|
* getlonglongargs --> getlonglongargGuido van Rossum1991-09-101-1/+1
|
* printobject now returns an error codeGuido van Rossum1991-06-071-3/+6
|
* In support of popen(), file objects are now parametrized with a closeGuido van Rossum1991-06-041-11/+32
| | | | | | function on creation. (There's a funny thing about the return value of the close function that should be resolved.) Also added 'isatty' method.
* Call clearerr() after EOF seen.Guido van Rossum1991-06-031-0/+1
|
* Added external interface to readline, for raw_input().Guido van Rossum1991-04-041-34/+71
|
* Added 'softspace' interface to replace 'needspace' printing hack.Guido van Rossum1991-04-041-1/+18
|
* Fixed read() and readline() to do arbitrarily long reads.Guido van Rossum1991-03-061-37/+178
| | | | | And readline() now reads null bytes correctly. Added tell(), seek() and flush().