It might be nice to make this function more efficient; cache the file contents, and re-read if the stat() or lstat() changes.