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.

File.exist? #?????????????????

I want to check if there is a particular .png file in the 'Pictures' directory. How can I do it?

I don't know how to do the File.exist? command properly.
Please help.

Thank You.
 
kaB00M":dmg9x0tm said:
What? :huh:
I tried something like this and failed miserably. It actually worked like:
File.exists?("Graphics/Characters/picture.png")

Thanks a lot. :thumb:
I recommend using the FileTest class instead. It was made specifically for this purpose, as well as for a couple other uses. [rgss]FileTest.exist?("Graphics/Characters/picture.png")
[/rgss]
 

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