Page 1 of 1

Copying Directory

Posted: Wed May 08, 2019 4:30 am
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

Re: Copying Directory

Posted: Wed May 08, 2019 4:12 pm
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

Re: Copying Directory

Posted: Thu May 16, 2019 5:51 am
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

Re: Copying Directory

Posted: Thu May 16, 2019 5:30 pm
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

Re: Copying Directory

Posted: Thu May 30, 2019 6:12 pm
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

Re: Copying Directory

Posted: Fri May 31, 2019 4:03 pm
by Joel
No problem, let me know if you run into anything else :)

All the best,
Joel

Re: Copying Directory

Posted: Thu Oct 03, 2019 6:05 am
by sunitapr
It is helpful information.