How can I create a file even if the some sub-directories dont exist? I am aware of this Question and its answer that suggests I use Directory.CreateDirectory(path)
to create both my file and its directories.
But when I attempt to create my file using Directory.CreateDirectory(path)
it creates the file as a directory/folder and not as a file?
Directory.CreateDirectory (@"C:\Users\me\AppData\LocalLow\company\product\database.db");
Why is database.db
a folder and not a file? Am I doing something wrong? How can I create a file even if the some sub-directories dont exist?