use dir to determine the proper permissions