Copying Directory

Easy Save 2 has been replaced by Easy Save 3, so is no longer supported.
Locked
User avatar
thatscraigz
Posts: 19
Joined: Tue May 17, 2016 3:42 am

Copying Directory

Post by thatscraigz »

Hi Joel!

Sorry for all these posts, just jumping back into an older project :lol:

I had a few quick questions about folder, also, I'm using Playmaker FWIW:

1. Is it possible to outright create a folder, or do I just save data and then have the folder created then?
2. Is there a direct way to copy folders? Or do I need to create a new directory (B) then get all the folders in (A) and copy them one by one to folder B?

Thanks! :D
-craigz
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Copying Directory

Post by Joel »

Hi craigz,

No problem regarding the posts :)

Folders are created automatically when you create a file, but otherwise we don't have any methods of actions to create an empty folder. However, this wouldn't be difficult to implement so if it's essential to your project then let me know and I'll put together an action for you.

With regards to copying a directory and it's contents, strangely not even C#/.NET has a method to do this. Instead you would need to use Get Files to get a list of files in the directory, and then re-save them in your new directory. If there are sub-directories, you would need to use the Get Directories action to get a list of sub-directories, and then do the same for these as you would the main directory. There's an example here of how you would achieve this in C# which might give you a better idea of how you would do it in Playmaker.

If that sounds too complicated, I'm happy to add a feature request for a Copy Directory action :)

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
User avatar
thatscraigz
Posts: 19
Joined: Tue May 17, 2016 3:42 am

Re: Copying Directory

Post by thatscraigz »

Hi Joel!

I gave myself a bit this week to try and tackle this in an FSM template, but just can't seem to get it to work :oops: Playmaker is really flopping with trying to do recursive things while maintaining sort of "temp" variables. Bah. I got something that sort of works, but only 2 directories deep :cry:

Is there any way I could put in a request for a copy directory action please? It would mean a ton to me :)

Best,
craigz
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Copying Directory

Post by Joel »

Hi craigz,

I've added a feature request for this here: https://moodkie.com/forum/viewtopic.php?f=14&t=1630

Note that I've added this request for Easy Save 3 as we're no longer adding features to Easy Save 2.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
User avatar
thatscraigz
Posts: 19
Joined: Tue May 17, 2016 3:42 am

Re: Copying Directory

Post by thatscraigz »

Just wanted to pop back in and say no problem about the request filing for ES3, totally makes sense :D

I've almost got the project converted over, completely worth it! :D

Thanks for everything Joel!

-craigz
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Copying Directory

Post by Joel »

No problem, let me know if you run into anything else :)

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
sunitapr
Posts: 1
Joined: Thu Oct 03, 2019 5:58 am

Re: Copying Directory

Post by sunitapr »

It is helpful information.
Locked