Portable file locking and directory reading
