file open permission checking working; lots of debug messages