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.

Convert Long File Names to Short File Names in Ruby

So first off I'm not really sure as to where to put this topic seeing how there isn't an actual generic programming board, but that's besides the point.

My question for you guys is...how can I convert a file name to a shorter file name, in a UTF 8.3 format in Ruby?

For example in command prompt/DOS you can type in the command 'dir /x' which will display all the files in the currently opened directory and will show the shortened version of the file names beside the full name. For example when I do that I have a file on my hard drive called 'My Programs' but when I type 'dir /x' it'll then become 'MYPROG~1' so that I can now use that shorter name as a parameter in a command because the longer 'My Programs' version will not work due to the space in it's name.
 
Well spaces don't work the way I'm using them. Basically opening up a folder and selecting a random program out of it and then running it through this methodology...
Code:
system("start file path")
So really I'm just trying to convert what I have, which is basically just a string, to a shorter string, in UTF 8.3 format.
 

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