in reply to Monitor Directory modification

Linux has an api for this. It's the F_NOTIFY fcntl. Read the fcntl(2) manpage for details.