Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

How to create a new directory using RGSS? [RESOLVED]

I just had a thought: I've seen a lot of people post their scripts which require an additional directory to function. (Fonts, Snapshots, etc...) At first I didn't think twice but recently, I've been wondering why they don't have their script create a new directory automatically. I know that in Ruby this can be accomplished via the following code:

Code:
FileUtils.mkdir_p 'New Folder'

But this requires the free FileUtils module by Minero Aoki, which is included in the standard Ruby distribution but for some reason, is not available in RMXP.

Is there any other way to go about this?
 
Here you go, You'll want to make sure the directory doesnt already exist or it'll crash when trying to create it.
Code:
  unless FileTest.directory?("Dir")

    Dir.mkdir("Dir")

  end
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top