Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9162973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:20:22+00:00 2026-06-17T14:20:22+00:00

My application is mostly c++ (using NDK) so I use fopen , fwrite ,

  • 0

My application is mostly c++ (using NDK) so I use fopen, fwrite, etc. standard functions to create and game save files and write into them.

When I use fopen("game.sav", "wb"), it appears that it’s being created at path

/data/user/10/com.my.game/files/game.sav.

My app is multi-user. So I want to have a separated folders where users store their save-files. And instead of the path above I’d like to have paths like

/data/user/10/com.my.game/files/user0/game.sav,

/data/user/10/com.my.game/files/user1/game.sav, etc

My app’s frontend is in Java, and when new user is being registered, I want to create a folder /data/user/10/com.my.game/files/user0/. But I don’t know how to do it, because

final File newDir = context.getDir("user0", Context.MODE_PRIVATE);

results in path being created at /data/user/10/com.my.game/app_user0 that’s a different path.

It is possible to create folders at /data/user/10/com.my.game/files/ and how ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T14:20:22+00:00Added an answer on June 17, 2026 at 2:20 pm

    Simple way to do it, this code you can change it suit many conditions. If you know that your path is different from what getFilesDir() gets you then you can create a File first of all by using a path that you know and the last 2 lines of code will still be same.

        File file = this.getFilesDir(); // this will get you internal directory path
        Log.d("BLA BLA", file.getAbsolutePath());
        File newfile = new File(file.getAbsolutePath() + "/foo"); // foo is the directory 2 create
        newfile.mkdir();
    

    And if you know the path to “files” directory:

         File newfile2 = new File("/data/data/com.example.stackoverflow/files" + "/foo2");
        newfile2.mkdir();
    

    Both code works.

    Proof of Working:

    Proof of working:

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iPhone application that is mostly using standard controls. There is one
How do I debug a Node.js server application? Right now I'm mostly using alert
In my Silverlight application I'm using mostly XmlReader but I'm playing with idea to
I'm usually a C# developer, but writing a mostly-client side application using jQuery. It
I'm developing bunch of relatively small Spring based java web-application. I'm mostly using annotations
In an ASP.NET application, I'm using iTextSharp (PdfStamper, mostly) to fill in some content
I am developing a somewhat complex, mostly AJAX application using symfony 1.4. It would
I want to create web application using Grails. The main layout consists of few
I am using Hibernate and mySQL. I develop the java application mostly on windows.
I am using Visual Studio 2010 to debug an application mostly written in C.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.