Iterating through a Directory and storing the maximium file number as an integer