Lord KJWilliams
Member
Ok, heres another one of my headaches with GMS....
I notice that only the Windows version of GMS2, has the feature of letting you check a files attributes. Well the most important
file attribute that I need is to know for a file is, if a file is read only. Lets, say I want to import my game to a Linux or
MacOS that has GMS2.....
How do you program your game to check whether a file will let you write to it or on a Linux or MacOS platfrom, in GMS2 ?
If I want to overwrite an existing file, or append data to an existing file, or delete an existing file, then I want to check to see
if the read only file attribute exists beforehand....... because if I don't, something bad will happen. It wouldn't make sense
to try and write to a file that is read only, and not inform the user through the game that it cant write to that file. However
the manual doesn't say what exists instead for the other licenses of GMS for Linux or MacOS platforms, in this circumstance.
So the other idea that came to my mind... that maybe there is a error value that I need to check for when I open a file for
writing. I did not find one thing about a error value to check for in any of the functions that open files for writing, when
those functions fail. Not one of any of the examples provided in the manual demonstrates in the code examples, show how to
use those functions, using a if statement to check if those functions fail, to tell the user ( or the programmer ) that they cant
open the file for writing to ( in the case that the file exists and its permissions are set to read only ).
Since the Windows version of GMS is the only version that allows the program to check to see if a file is read only,
the conclusion that I am thinking ( which I hope is not true ), is that for the other two platforms, Linux and MacOS which
don't have that feature in gml to check a file attribute, is that you have to inconvenience the user player with the task, of
having them go outside of the game, to check if the file is read only or not, by using the OS.
Is this a design fault of GMS, or what is the solution ? I am just going by what I am reading in the manual.
I notice that only the Windows version of GMS2, has the feature of letting you check a files attributes. Well the most important
file attribute that I need is to know for a file is, if a file is read only. Lets, say I want to import my game to a Linux or
MacOS that has GMS2.....
How do you program your game to check whether a file will let you write to it or on a Linux or MacOS platfrom, in GMS2 ?
If I want to overwrite an existing file, or append data to an existing file, or delete an existing file, then I want to check to see
if the read only file attribute exists beforehand....... because if I don't, something bad will happen. It wouldn't make sense
to try and write to a file that is read only, and not inform the user through the game that it cant write to that file. However
the manual doesn't say what exists instead for the other licenses of GMS for Linux or MacOS platforms, in this circumstance.
So the other idea that came to my mind... that maybe there is a error value that I need to check for when I open a file for
writing. I did not find one thing about a error value to check for in any of the functions that open files for writing, when
those functions fail. Not one of any of the examples provided in the manual demonstrates in the code examples, show how to
use those functions, using a if statement to check if those functions fail, to tell the user ( or the programmer ) that they cant
open the file for writing to ( in the case that the file exists and its permissions are set to read only ).
Since the Windows version of GMS is the only version that allows the program to check to see if a file is read only,
the conclusion that I am thinking ( which I hope is not true ), is that for the other two platforms, Linux and MacOS which
don't have that feature in gml to check a file attribute, is that you have to inconvenience the user player with the task, of
having them go outside of the game, to check if the file is read only or not, by using the OS.
Is this a design fault of GMS, or what is the solution ? I am just going by what I am reading in the manual.