playMaker

Author Topic: copy file (FileUtil: copy)  (Read 4559 times)

MS80

  • Junior Playmaker
  • **
  • Posts: 64
copy file (FileUtil: copy)
« on: September 03, 2014, 09:51:54 AM »
I would like to copy a file (pdf, jpg, mov, etc.) from one directory to another.

With FileUtil this seems to be possible and uncomplicated.
"FileUtil.CopyFileOrDirectory ( sourcePath, destinyPath );"

Maybe there is already a similar action to copy files out there?! I did not found a action for this situation....

Would be great to have a action with the following functionality:
- path source (absolute / relative with StreamingAssets)
- path destination (absolute / relative with StreamingAssets)
- file existing? folder existing?
- file written? failed?

Mark_T

  • 1.2 Beta
  • Junior Playmaker
  • *
  • Posts: 72
Re: copy file (FileUtil: copy)
« Reply #1 on: January 18, 2016, 04:19:23 AM »
I`m working to a non game application in Unity, and I would like to copy/paste some files from one location to another. Unfortunatelly, I`m not a coder, so I`m not able to write my own action. Would it be possile to get such actions: copy/paste/move files, with input request from user if needed.
Thanks.

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: copy file (FileUtil: copy)
« Reply #2 on: January 18, 2016, 04:42:16 PM »
There seem to be some actions in ecosystem related to this (create folder, check if file exists, load from files, etc)..

Mark_T

  • 1.2 Beta
  • Junior Playmaker
  • *
  • Posts: 72
Re: copy file (FileUtil: copy)
« Reply #3 on: April 18, 2016, 07:29:35 PM »
dudebxl - thanks for the delete file action. I`ll be really grateful if you can help with a copy file action (source/destination overwrite options). I checked everywhere and there is no such action. Cheers!

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: copy file (FileUtil: copy)
« Reply #4 on: April 19, 2016, 12:33:50 PM »
I don't think you need a new action. To copy, just get all the data from file and create new one and insert the data. To overwrite, just delete the file and then create a new one with new data.


craigz

  • Beta Group
  • Full Member
  • *
  • Posts: 234
    • Haven Made
Re: copy file (FileUtil: copy)
« Reply #5 on: May 08, 2019, 01:08:49 AM »
Sorry to necro :)

Can someone doublecheck if the 'Create Folder' action is still present? Not popping up on ecosystem for me :/

Also, is there any direct way to copy a folder? Or is it best to iterate through another folder and just copy files individually?

Thanks!
craigz

autumnboy

  • Junior Playmaker
  • **
  • Posts: 73
Re: copy file (FileUtil: copy)
« Reply #6 on: August 30, 2019, 08:51:51 PM »
+2 Is the create folder action lurking somewhere please?