Properly retrieve file permissions