Changes between Version 56 and Version 57 of RepyV2API

Changes between Version 56 and Version 57 of RepyV2API

Please note that these Trac pages are no longer being updated. Wiki contents/documentation have moved to GitHub.

Changes between Version 56 and Version 57 of RepyV2API

Please note that these Trac pages are no longer being updated. Wiki contents/documentation have moved to GitHub.

Changes between Version 56 and Version 57 of RepyV2API

Show
Ignore:
Timestamp:
12/23/09 22:04:32 (10 years ago)
Author:
justinc
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RepyV2API

    v56 v57  
    489489 
    490490[[BR]] 
    491 ==== file.readat(size=None, offset=None) ==== 
    492 ---- 
    493  
    494 If offset is an integer, first seek to that location in the file. (If it is omitted or None, no seek is performed.)  Each file object instance has its own offset even if they operate on the same file.       
    495  
    496 Reads up to size bytes of the rest of the (open) file, returning what is read. If size is omitted or None, the file is read to EOF. 
    497  
    498  * Doc string: 
    499  
    500    <Purpose> 
    501       Reads from a file handle. 
    502  
    503    <Arguments> 
    504       size (optional) - Specify a maximum number of bytes to read from the 
     491==== file.readat(sizelimit, offset) ==== 
     492---- 
     493 
     494Seek to a location in a file and reads up to sizelimit bytes from the file, returning what is read. If sizelimit is None, the file is read to EOF. 
     495 
     496 * Doc string: 
     497 
     498   <Purpose> 
     499      Reads from a file handle.   Reading 0 bytes informs you if you have read past the end-of-file, but returns no data. 
     500 
     501   <Arguments> 
     502      sizelimit - Specify a maximum number of bytes to read from the 
    505503                        file.   Hitting EOF will read less. 
    506504 
    507       offset (optional) - Seek to a specific location in the file before 
     505      offset - Seek to a specific location in the file before 
    508506                          reading. 
    509507 
     
    511509      ValueError if the file is closed. 
    512510 
    513       TypeError if offset or size is not an integer. 
    514  
    515    <Side Effects> 
    516       Seeks to offset (if specified) and advances the file pointer by the 
    517       number of bytes read. 
     511      TypeError if offset or sizelimit is not a non-zero integer. 
     512 
     513      XXXException if trying to read past the end of the file 
     514 
     515   <Side Effects> 
     516      Reads data from persistent storage.   All write calls that occurred before this operation will be reflected in the data that is read. 
    518517 
    519518   <Resource Consumption> 
     
    521520 
    522521   <Returns> 
    523       The data that was read; this may be the empty string only if we 
    524       have reached the end of the file or size was non-positive. 
    525  
    526 [[BR]] 
    527 ==== file.writeat(data, offset=None) ==== 
    528 ---- 
    529  
    530 If offset is an integer, first seek to that location in the file. If it is omitted or None, no seek is performed.   Each file object instance has its own offset even if they operate on the same file.       
    531  
    532 Write some data to a file. 
     522      The data that was read; this may be the empty string if we 
     523      have reached the end of the file.    The only other case where 
     524      the returned data is empty is when the sizelimit was zero and  
     525      the offset was within the file. 
     526 
     527[[BR]] 
     528==== file.writeat(data, offset) ==== 
     529---- 
     530 
     531Seek to the offset in the file and then write some data to a file. 
    533532 
    534533 * Doc string: 
     
    546545      ValueError if the file is closed. 
    547546 
    548       XXXException if the disk is out of space or some low level IO error occurs. (I don't think we care about this either -- do we expect authors of Repy programs to catch and handle such problems?) 
    549  
    550       TypeError if offset isn't an integer or data isn't a string. 
    551  
    552    <Side Effects> 
    553       If offset is included, seeks to offset. 
    554  
    555       Writes some data after the current filepointer position, advancing it. 
    556  
     547      An interal error terminates the program if the disk is out of space or some low level IO error occurs.  
     548 
     549      TypeError if offset isn't an non-negative integer or data isn't a string. 
     550 
     551      XXXException if the offset is past the end of the file. 
     552 
     553   <Side Effects> 
     554      Writes data to persistent storage. 
     555  
    557556   <Resource Consumption> 
    558557      Consumes 4K of filewrite for each 4K aligned-block of the file written.   All writes consume at least 4K.    
     
    607606 
    608607      TypeError/ValueError if the filename param isn't the right type or is an invalid filename 
     608 
     609      '''Justin: ??? What if the file is open???''' 
    609610 
    610611   <Side Effects>