[Tutor] How to check a files size

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Thu Jun 29 20:20:32 CEST 2006


>> Why isn't this function in the os module with the other file commands?
>
> I don't know why they are broken up in this way. The glob module also 
> has some file access commands.

For the most part, the 'os' module follows the interface functions that C 
provides to access the operating system.  We can think of 'os' as the 
foundation for other high-level modules like 'shutil'.

But there's probably a bit of historical cruft involved here too. 
os.path.walk() and os.walk() duplicate each other's behavior, but neither 
can be removed without some effort.  Legacy is a hard nut to crack.  As 
another concrete example, we can look at 'fnmatch', whose functions should 
really live in the 'glob' module.


More information about the Tutor mailing list