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

Since Rob's suggestion was to open the file, you would need to close it.

Since SD.exists() doesn't actually open the file, there is no need to close it.