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.

Creating files in temporary memory

Hi everyone.
I was creating a tool using RMXP, and I just need to know, how to create a file, in a temporary folder(I think Windows has a particular one, or something like that, but don't know the name), to be deleted after the game closes. Should be a reference data, with a big size, like 40mb~100mb.
How to create and delete files, I know, but my question is, in Windows, there is a folder destinated to it? Any suggestions and ideas are welcome.
 
Well first thing to do is to get windows temp folder (back in 98 it was a in C:\Windows\Temp\ but since XP it has changed to User folder and Windows\Temp was only left for backwards compatability).

And how to obtain it's location depends on programming language you're currently using, but mostly it can be obtained from enviroment variables, or registry.

When you create those files, keep the path of every file in list which will be used at the end of the program to delete it.

Again how to do it depends on which programming language you're using.
 

Zeriab

Sponsor

Use ENV['TEMP'] for finding the temporary folder.

On a side note it seems that you can create files, but cannot delete files procs given to at_exit in RMXP.
 

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