objfile read('jello stdio file\nhello descriptor file\nobjfile os fdopen(fdfile' 'encoding='latin 'closefd=trueobjfile seek( objfile read('jello stdio file\nhello descriptor file\nwe'll make use of this file object wrapper technique to simplify text-oriented pipes and other descriptor-like objects later in this book ( sockets have makefile method which achieves similar effectsother os module file tools the os module also includes an assortment of file tools that accept file pathname string and accomplish file-related tasks such as renaming (os rename)deleting (os remove)and changing the file' owner and permission settings (os chownos chmodlet' step through few examples of these tools in actionos chmod('spam txt' enable all accesses this os chmod file permissions call passes -bit string composed of three sets of three bits each from left to rightthe three sets represent the file' owning userthe file' groupand all others within each setthe three bits reflect readwriteand execute access permissions when bit is " in this stringit means that the corresponding operation is allowed for the assessor for instanceoctal is string of nine " bits in binaryso it enables all three kinds of accesses for all three user groupsoctal means that the file can be read and written only by the user that owns it (when written in binary octal is really bits this scheme stems from unix file permission settingsbut the call works on windows as well if it' puzzlingsee your system' documentation ( unix manpagefor chmod moving onos rename( ' :\temp\spam txt' ' :\temp\eggs txt'fromto os remove( ' :\temp\spam txt'delete filewindowserror[error the system cannot find the file specified' :\\temp\os remove( ' :\temp\eggs txt'the os rename call used here changes file' namethe os remove file deletion call deletes file from your system and is synonymous with os unlink (the latter reflects the call' name on unix but was obscure to users of other platformsthe os module also exports the stat system callfor related toolssee also the shutil module in python' standard libraryit has higher-level tools for copying and removing files and more we'll also write directory comparecopyand search tools of our own in after we've had chance to study the directory tools presented later in this file tools