What is the performance of that method ?
I am creating multiple directories very often.So, as a start, write a sample program that just creates a bunch of directories as fast as possible, and see if that's sufficient for your needs. If that program can create directories 100 times faster than you expect to need them, you don't have anything to worry about. If it does so less than twice as fast as you need, then you may have a problem.
I just needed to know if that invocation is better to using createNewFile()That sort of answer is exactly why I asked 'compared to what?' They do different things. Apples and oranges. The only alternative to File.mkdirs() is to parse the filename and call File.mkdir() yourself for each directory, and there's no reason to believe that would be any faster.
javaUserMuser wrote:When you wake up, review my advice in reply 1: Create a sample program that does nothing but create directories and files in a pattern that's representative of your actual use case, and time it. If it's too slow, post it here (make sure it's an SSCCE that just shows the relevant file/directory operations and no extra fluff) and explain exactly what the problem is.
Eh, Im sorry, its 5 am here, I have had no sleep for 24+ hours.. Cannot think clearly .. Im going to sleep now. Have a nice day, thanks for the help, and happy coding ;)
See you tomorrow.