# saveStrings creates a new file when exported application

**URL:** https://discourse.processing.org/t/savestrings-creates-a-new-file-when-exported-application/30526
**Category:** Coding Questions
**Created:** [June 6, 2021, 9:28am UTC](https://discourse.processing.org/t/savestrings-creates-a-new-file-when-exported-application/30526 "2021-06-06T09:28:43Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![abatllei](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@abatllei](https://discourse.processing.org/u/abatllei)
#### Post date: [June 6, 2021, 9:28am UTC](https://discourse.processing.org/t/savestrings-creates-a-new-file-when-exported-application/30526/1 "2021-06-06T09:28:43Z")

</div>

I’m programming a game where I want to save the final points, like a highscore. Same problem as this topic: [https://discourse.processing.org/t/save-string-to-txt-file-when-the-program-is-a-standalone-application/26898?u=abatllei](https://discourse.processing.org/t/save-string-to-txt-file-when-the-program-is-a-standalone-application/26898)  
The thing is, when I run the sketch with the Processing platform, it writes the actual game points at the .txt inside de “data” folder, but when I do it with the exported application, it creates a new .txt file, with the same name, at the same folder as the application (ex. if I have the application at my Desktop, when the game has to save the value, it creates a new .txt file at Desktop).  
This “new” .txt file is the same as the one that is at the “data” folder, but with the new value written.  
I wish you can help me, it’s my university final project and I have to have this for the next week!

---

<div class="post-metadata">

### Author: ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)
#### Post date: [June 6, 2021, 9:40am UTC](https://discourse.processing.org/t/savestrings-creates-a-new-file-when-exported-application/30526/2 "2021-06-06T09:40:51Z")

</div>

Miggt want to try finding the absolute path of your sketch and passing that through a buffered writer or filewriter if you want better consistency.

---

<div class="post-metadata">

### Author: ![abatllei](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@abatllei](https://discourse.processing.org/u/abatllei)
#### Post date: [June 6, 2021, 5:18pm UTC](https://discourse.processing.org/t/savestrings-creates-a-new-file-when-exported-application/30526/3 "2021-06-06T17:18:22Z")

</div>

Sorry, I don’t understand. How do I do this?

---

<div class="post-metadata">

### Author: ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)
#### Post date: [June 6, 2021, 10:10pm UTC](https://discourse.processing.org/t/savestrings-creates-a-new-file-when-exported-application/30526/4 "2021-06-06T22:10:50Z")

</div>

ok so you might not need to worry about using a bufferedread/filewriter. Try this code and let me know if it works. This just gives you the absolutepath of the data folder.

```auto
String l;

void setup() {
  l = dataPath("test.txt");
  println(l);
  String[] data = {"test","test"};
  saveStrings(l,data);
};

void draw() {
};

public String dataPath(String where) {
  return dataFile(where).getAbsolutePath();
};

```

---

<div class="post-metadata">

### Author: ![abatllei](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@abatllei](https://discourse.processing.org/u/abatllei)
#### Post date: [June 7, 2021, 8:10pm UTC](https://discourse.processing.org/t/savestrings-creates-a-new-file-when-exported-application/30526/5 "2021-06-07T20:10:19Z")

</div>

That worked! Thanks!!
