added getMode method to determine the chmod on unix systems