# Save() "file contains a path separator"

**URL:** <https://discourse.processing.org/t/save-file-contains-a-path-separator/19455>\
**Category:** Processing for Android\
**Created:** [April 6, 2020, 4:31am UTC](https://discourse.processing.org/t/save-file-contains-a-path-separator/19455 "2020-04-06T04:31:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JentGent](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@JentGent](https://discourse.processing.org/u/JentGent)\
**Post date:** [April 6, 2020, 4:31am UTC](https://discourse.processing.org/t/save-file-contains-a-path-separator/19455/1 "2020-04-06T04:31:11Z")

</div>

I’m trying to `save()` an image of the screen to `data/frames` (relative to my sketch file). The code I’m using works in Java mode with no problems (I can see the image saving into the correct folder), but when running it on my Android device I get `java.lang.IllegalArgumentException: File data/frames/frameasdf.tif contains a path separator `. I’m assuming this is because of a difference in file storage systems. Is there any way I can avoid path separators other than saving images directly into the sketch folder?  
I’m pretty new to Java (just moved over from Javascript for more professional development), so if possible, please link to any helpful documentation.

```auto
PImage drawing;
void setup() {
  size(displayWidth, displayHeight);
}

boolean clicked = false;
String name = "asdf";

void mouseReleased() {
  clicked = true;
}

void draw() {
  background(255);
  if(drawing != null) {
    image(drawing, 0, 0);
  }
  fill(0);
  noStroke();
  ellipse(mouseX, mouseY, 50, 50);
  if(clicked) {
    save("data/frames/frame" + name + ".tif");
    drawing = loadImage("frames/frame" + name + ".tif");
  }
  
  clicked = false;
}

```

This is a shortened version of my code.  
I do plan on saving more than one frame in the frames folder.

---

<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 6, 2020, 6:12am UTC](https://discourse.processing.org/t/save-file-contains-a-path-separator/19455/2 "2020-04-06T06:12:35Z")

</div>

@JentGent Try not including `data` folder in your path.

But safest give the absolute path this should solve your problem eg

```bash
/home/tux/sketchbook/my_sketch_name/data/folder/my_image.tiff

```

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [April 8, 2020, 3:53am UTC](https://discourse.processing.org/t/save-file-contains-a-path-separator/19455/3 "2020-04-08T03:53:40Z")

</div>

> [@JentGent](#):
>
> I do plan on saving more than one frame in the frames folder

Also to save frames on Android, you can find a code [here.](https://github.com/EmmanuelPil/Android-java-code-utilities-widgets-for-Processing-for-Android)
