# How to force a path to write a file outside of the sketch directory?

**URL:** https://discourse.processing.org/t/how-to-force-a-path-to-write-a-file-outside-of-the-sketch-directory/29579
**Category:** Coding Questions
**Created:** [April 23, 2021, 2:12pm UTC](https://discourse.processing.org/t/how-to-force-a-path-to-write-a-file-outside-of-the-sketch-directory/29579 "2021-04-23T14:12:24Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Liu.Exit](https://avatars.discourse-cdn.com/v4/letter/l/a4c791/32.png) [@Liu.Exit](https://discourse.processing.org/u/Liu.Exit)
#### Post date: [April 23, 2021, 2:12pm UTC](https://discourse.processing.org/t/how-to-force-a-path-to-write-a-file-outside-of-the-sketch-directory/29579/1 "2021-04-23T14:12:24Z")

</div>

SelectFolder is not suitable for me because it opens a window …  
Thanks.

---

<div class="post-metadata">

### Author: ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)
#### Post date: [April 23, 2021, 3:03pm UTC](https://discourse.processing.org/t/how-to-force-a-path-to-write-a-file-outside-of-the-sketch-directory/29579/2 "2021-04-23T15:03:47Z")

</div>

You just need to give the fully qualified path of what you need to save eg if saving an image on linux to home directory:-

```java
save("/home/tux/image.png");

```

You will of course need write permission.

---

<div class="post-metadata">

### Author: ![Liu.Exit](https://avatars.discourse-cdn.com/v4/letter/l/a4c791/32.png) [@Liu.Exit](https://discourse.processing.org/u/Liu.Exit)
#### Post date: [April 24, 2021, 6:30am UTC](https://discourse.processing.org/t/how-to-force-a-path-to-write-a-file-outside-of-the-sketch-directory/29579/3 "2021-04-24T06:30:06Z")

</div>

OK, thanks. I had to run as administrator

---

<div class="post-metadata">

### Author: ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)
#### Post date: [April 24, 2021, 8:41am UTC](https://discourse.processing.org/t/how-to-force-a-path-to-write-a-file-outside-of-the-sketch-directory/29579/4 "2021-04-24T08:41:02Z")

</div>

Ideally you don’t want to be writing to a protected folder with admin rights, depending on your setup it may be safer to give yourself write access to a specific folder.
