I've been trying to do this but I can only find Ruby answers. I'm trying to move or copy a file from, say, Game Directory/Graphics/Pictures/file.png to Game Directory/file.png. How can I do this in RGSS?
\$\begingroup\$
\$\endgroup\$
2
-
\$\begingroup\$ And why can't you work with those mentioned Ruby answers? RGSS is just a library, but still uses Ruby. Or what exactly are you looking for as opposed to Ruby answers? \$\endgroup\$Philip Allgaier– Philip Allgaier2014-03-16 11:00:44 +00:00Commented Mar 16, 2014 at 11:00
-
\$\begingroup\$ Because I'm using RPG Maker XP. I've tried the solutions, but things used in them - like FileUtils - aren't included in RPG Maker. \$\endgroup\$Gus– Gus2014-03-16 17:07:55 +00:00Commented Mar 16, 2014 at 17:07
Add a comment
|
1 Answer
\$\begingroup\$
\$\endgroup\$
1
Well, I found two answers. The first one, way simpler and the one I'm going to use is just using File.rename(from, to).
The second solution, a bit more complicated for the simple and one-use action I wanted to do, is to add the FileUtils module to your scripts, then use FileUtils.mv(from, to).
-
1\$\begingroup\$ just to clarify for anyone else reading this. File.rename will move the file, not copy it. \$\endgroup\$Brad– Brad2019-07-10 06:06:12 +00:00Commented Jul 10, 2019 at 6:06