Pages

Sunday, May 21, 2006

os.listdir iterator

I found an iterator version of os.listdir for POSIX(?) systems, but I needed one for Windows. Specifically to check if a directory has subdirectories.

import win32file
import pywintypes
def has_subdirectories(path):
try:
for info in win32file.FindFilesIterator(os.path.join(path, "*")):
if info[0] & win32file.FILE_ATTRIBUTE_DIRECTORY and info[-2] not in [".", ".."]:
return True
except pywintypes.error: # access denied
pass
return False

Thursday, May 04, 2006

Characterizing People as Non-Linear, First-Order Components in Software Development

Alistair Cockburn has written a lot of very interesting articles but I have to agree with John Carter on Lambda the Ultimate when he called this one his "absolute favourite paper in all the CS literature".