What's the directory of a file? Do you mean it's location, as in if the file is c:\some\path\to\the_file.txt, then you want to store c:\some\path\to?