[PythonCE] The os module

Jeffrey Nix chronowarper at netscape.net
Thu Nov 20 14:32:32 EST 2003


The os module is ment to encapsulate the functions of other modules and provide a single cross-platform implementation. To provide platform level functions such as getcwd, chdir, listdir, etc. the os module imports a platform specific module on WinCE it is the ce module, on POSIX platforms it uses posix, on nt platforms (Windows) it uses the nt module, on os2 it uses os2, on MacOS it uses mac, and on riscos it uses riscos.
It also imports a specific module as 'os.path' (I'm not going to list them you can look in os). On ce os.path is actually the module ntpath.
Also it defines some specific functions derived the platform specific module it imports these are makedirs, removedirs, renames, walk, and others. You could implement getcwd and chdir very easily in python in the os module. From my understanding WinCE has no concept of cwd so it would be pointless to implement them in C (since you can't get the real thing why spend all that effort make a simulation of it in C when you can quickly do it in Python?) Anyway make sure that whatever modifications you make that they are platform independent (ie your getcwd and chdir are only used on ce) and maybe you could get them incorporated into the next os release. Also os is made for all platforms PythonCE uses the same version of os as every other platform, it's differences are the result of the platform dependent modules it imports.

__________________________________________________________________
McAfee VirusScan Online from the Netscape Network.
Comprehensive protection for your entire computer. Get your free trial today!
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397

Get AOL Instant Messenger 5.1 free of charge.  Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455



More information about the PythonCE mailing list