• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Windows Reading the volume label name and the 3 physical RAM properties of a mounted device

( this is unedited - so ask questions if I am not clear on anything )

First off, this is a problem that has been bugging me for a long time. This is a feature that I wish I could use from programming - because its a feature
that all software wizards that install software on Windows OS machines have, and even in the past in MS-DOS.

What is the problem that I want to do in GML ( and C and C++ ) which I want to do?

I want to be able to read the volume name of a mounted device like a USB flash drive / or a external USB hard drive and the 3 physical RAM properties
of the device in to my program. This is for creating in GML a volume registry program that you can use to track on external mediums where the data you write so that if you run out of room and use a new mounted device continue saving the data it tracks the files to that device too. This is to help organize and remember for the player , which mounted device by volume name ( and a nick name that the user creates for the mounted device in the game*1 ) where
the files are that it is requesting.

*1 note: The reason for the nick name is that, Windows does not care if you name numerous USB flash drives ( or several external USB hard drives ) with the same volume label name. You can use multiple flash drives with the same volume name label and use them one at a time with the computer, or plug more than one of them in the computer if you have the USB ports for that many USB flash drives. The GML program writes a .ini file , a "dog tag", to identify it along with the last time it updated the 3 physical RAM values on the USB flash drive and in the games directory on the device its mounted on ( the local hard drive of the computer ). The most specific information to make each USB flash drive different is a user designated nick name which is unique, that distinguishes that one USB flash drive from a collection of USB flash drives. This is how the registry program would distinguish the difference, by reading the dog tag that is recorded on both mediums ( the USB flash drive and the games volume registry record system ).

( relating to my game specifically )
The reason I want this feature for my game, is that the mapping data in my game design that is specific to what the player has explored or discovered in the game and the specific player save files can be written on a USB flash drives, AND when the space runs out on a USB flash drive device the data can continue on the next device and the registry program records this so it knows where that data is. I can expand on this explanation if you ask.

The information I want to get in GML ( and I wish for C or C++ too ) is seen in this snapshot of my computer's HD info

device_capacity.png

The specific information I want read in GML, is the volume name, the capacity of the device, the space left available of the device, and the space used in the device. This would open the door to many possibilities that I could do with my volume registry program idea that I want integrated into my game to use.


How is it possible that when I install a new version of GMS on my computer , the installation wizard has access to this information?

GMS_installation_drive_space.png

The " Space Available " is an example of one of those pieces of information that I would want my game to have access to.

This is a feature that I CANT do, in C or C++, let alone GML. Long ago when I was programming in MS-DOS, a company called Symantec ( now called Norton ), had this program called "xtreegold" which also had the means of getting those 4 pieces of information. Microsoft never made a MSDOS command where you could
get those specific pieces of information and redirect the output using " > " to a text file. No compiler brand ever made a MS-DOS/Windows platform
specific function for C or C++, that allows me to get this information. If it did, it would have existed in GMS, by now - in this age of programming.
This should be a standard ISO/ANSI standard for C or C++, because all removable computer mediums have had these four pieces of data, since
the invention of floppy disks. Yet, I have to deal with the stupid logic of why the ISO standard for C and C++ never did. Volume label name, RAM capacity, RAM used, and RAM, available are universal mission critical pieces of information that the OS uses , that any programming should have access to as well in
Windows machine.

Any help would be appreciated, thanks.
 

chamaeleon

Member
These are operating system specific items and as such would belong in the set of libraries and commands Microsoft provides.
Powershell example
Code:
PS > Get-CimInstance -classname win32_logicaldisk
Code:
DeviceID DriveType ProviderName VolumeName Size          FreeSpace
-------- --------- ------------ ---------- ----          ---------
C:       3                                 999625322496  140140851200
D:       3                      Internal   2000396742656 858144010240
E:       5
F:       3                      Media 1    2000396288000 1484659617792
G:       3                      Media 3    1000202039296 945337524224
I:       5
You can knock yourself out with information for Windows Management Instrumentation (translating anything there to Powershell commands or library function calls is left as an exercise for the interested reader).
 
Last edited:
Top