# Contents Of The Folder Not Being Copied With It

**URL:** <https://discourse.processing.org/t/contents-of-the-folder-not-being-copied-with-it/24293>\
**Category:** Coding Questions\
**Created:** [October 2, 2020, 7:56pm UTC](https://discourse.processing.org/t/contents-of-the-folder-not-being-copied-with-it/24293 "2020-10-02T19:56:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Charlie\_Dev](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@Charlie\_Dev](https://discourse.processing.org/u/Charlie_Dev)\
**Post date:** [October 2, 2020, 7:56pm UTC](https://discourse.processing.org/t/contents-of-the-folder-not-being-copied-with-it/24293/1 "2020-10-02T19:56:26Z")

</div>

I am copying files, but I need to copy folders. When I try to copy a folder the folder gets duplicated but there is nothing inside of it. I think there are 2 solutions but I don’t know how to do either. I could either fix the system and make it copy everything, or I could zip the folder first. Anyone know how I could accomplish this?  
Here is my code. (This is my first time posting on the forums so hopefully I did the code box thing right 🙂 )

> import java.nio.file.Files;  
> import java.nio.file.Path;  
> import java.nio.file.Paths;  
> int Backupnum = 0;
> 
> void setup(){  
> frameRate(1);  
> }  
> void draw(){  
> Path oldFile = Paths.get(sketchPath()+“/Hey.zip”);  
> println(oldFile);  
> Path newFile = Paths.get(sketchPath()+“/Hey” + Backupnum + “.zip”);  
> println(newFile);  
> Backupnum = Backupnum + 1;  
> try{Files.copy(oldFile, newFile); } catch (IOException e) {println(“it didnt work”);  
> }  
> }
