[Tutor] Hotfolder 1st attempt

Daniel Yoo dyoo@hkn.eecs.berkeley.edu
Wed, 8 Nov 2000 00:46:28 -0800 (PST)


On Mon, 6 Nov 2000, Scott Ralph wrote:

> from time import *
> from stat import *

The only thing I could point out is that you might not want to import
everything within time or stat.  You can be more specific, like:

    from time import sleep

It's considered good practice to pull out only the functionality that you
need from modules; that way, people can see exactly which functions you're
using from other modules.

Another related reason is to avoid wacky problems with name conflicts: if
either the 'time' or 'stat' modules had shared the same function names,
one would have taken precedence over the other, which is tricky to detect.

Otherwise, from a quick look, I think that your program looks good.  You
might want to un-hardcode '20' from your code, and make it a parameter of
getDirContents.


I'm taking a local look into the statements now.

*** time passes ***


I'm not quite sure what:

>            S_ISREG(mode)

is doing; according to the documentation:

"""S_ISREG (mode) 
     Return non-zero if the mode is from a regular file."""

which means that it doesn't affect anything --- it only returns a true or
false value.  It looks mysterious, so you might want to check that
statement.


Hope this helps!