operating system services attribute description seek(offset[whence]moves the file pointer to new position relative to the location specified in whence offset is the number of bytes whence is for the start of the file for the current positionand for the end of the file seekable(returns true if is seekable tell(returns the current value of the file pointer truncate([size]truncates the file size so that it is at most size bytes if size isn' givenit truncates the file to bytes writable(returns true if was opened for writing writelines(lineswrites sequence of lines to line endings are not added so they must already be part of each line raw / the lowest level of the / system is related to direct / involving raw bytes the core object for this is fileiowhich provides fairly direct interface to low-level system calls such as read(and write(fileio(name [mode [closefd]] class for performing raw low-level / on file or system file descriptor name is either filename or an integer file descriptor such as that returned by the os open(function or the fileno(method of other file objects mode is one of ' (the default)' 'or 'afor readingwritingor appending '+can be added to the mode for update mode in which both reading and writing is supported closefd is flag that determines if the close(method actually closes the underlying file by defaultthis is truebut it can be set false if you're using fileio to put wrapper around file that was already opened elsewhere if filename was giventhe resulting file object is opened directly using the operating system' open(call there is no internal bufferingand all data is processed as raw byte strings an instance of fileio has all of the basic / operations described earlier plus the following attributes and methodsattribute description closefd flag that determines if the underlying file descriptor will be closed on close((read-onlyfile mode used when opening (read-onlyfilename (read-onlyreads at most size bytes using single system call if size is omittedas much data as possible is returned using readall(this operation may returns fewer bytes than requested so you must use len(to check none is returned if no data is available in non-blocking mode reads as much data as is available and returns as single byte string an empty string is returned on eof in non-blocking modeonly as much data as is immediately available is returned writes byte string or byte-array to using single system call the number of bytes actually written is returned--which may be less than the number supplied in bytes mode name read([size] readall( write(bytesf lib fl ff