1

So, I want to create a file in a folder on the desktop. But I don't want everyone who downloads the game to have to create that folder. Is there a way to do this? The did for the folder is:

/users/USER/desktop/MyFolder
1

2 Answers 2

1

I will direct you to the File Javadoc. It contains a few methods for creating new directories and files.

Example:

File file = new File("/users/USER/desktop/MyFolder");

if(!file.exists())
{
    file.makeDirs();
}
Sign up to request clarification or add additional context in comments.

Comments

1

Don't worry this folder will be created automatically direct from the File(class) code which is the best option:check this out too...

import java.io.*;

File myFile=new File("/users/USER/desktop/MyFolder","something..");/*for instance "something.txt"**/ 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.