See the File class. It has useful methods for you.