One question

Posted By: AlexTGM

One question - 12/23/09 15:14

Hi all!!!
I wouldlike to ask you one question:
When I compile script which should open a file(or create this file) and write a string I see that nothing happens mad.
Code:
var filehandle;
filehandle = file_open_write("test.txt");
file_str_write(filehandle,"a,Test");
file_close (filehandle);


Or I don't understand correct the meaning of this programm?
I hope you will answer me soon!!!
And one another question: don't someone gave a good highscore script?
P.S. Sorry for my bad English...
P.P.S. I use trial version of 7.82 and 7.80.1

Posted By: SchokoKeks

Re: One question - 12/23/09 16:53

are you using windows vista or 7 and is your project currently located on c:\program files\... ?
then vista probably denies access to that folder, and 3dgs can not create the file. it might even crash when trying to do so in a published version.
Posted By: AlexTGM

Re: One question - 12/23/09 19:26

I'm using Windows 7(not cracked + x64). Also I installed 3DGS in c:\program files(x86)\...
Please, help me... What can I do?
Posted By: Aku_Aku

Re: One question - 12/23/09 21:06

From the Manual:
Quote:
A path can be given with the file name. Otherwise the file is opened in the work folder.


Try to create and save a file manually in your 3DGS work folder. If you can't, you don't have enough permission to use that folder. Otherwise i don't know...
Posted By: AlexTGM

Re: One question - 12/24/09 12:01

I don't understand you... I try to create a file in folder with a script, and I can create a file manually in it... Maybe I should give a path in the script for file? Or reinstall this programm in c:\Program Files\... .Without (x86)???
Posted By: SchokoKeks

Re: One question - 12/24/09 12:58

no, it does not matter if the application is in program files with or without (x86). you can only save data in the "user" folder for the current user or onto other drives (not recommended), so when calling file_open_write you have to give a path to the user folder. you probably need a windows API function to get the path of the user folder, sorry but I can't help you with that.
Posted By: AlexTGM

Re: One question - 12/24/09 13:15

Oh... Where a file saves at defaults?
Posted By: SchokoKeks

Re: One question - 12/24/09 22:04

when you give no path, it saves in the folder where the main script is that you've run.
on windows XP the program has access there, but on vista or 7 it doesn't if the script is somewhere on drive C:
Posted By: Rei_Ayanami

Re: One question - 12/24/09 22:27

Originally Posted By: SchokoKeks
when you give no path, it saves in the folder where the main script is that you've run.
on windows XP the program has access there, but on vista or 7 it doesn't if the script is somewhere on drive C:


not really, because your profiles are also saved on C wink

but not in the program folder wink
Posted By: Lukas

Re: One question - 12/24/09 23:05

Your code looks fine, so it might be really because of missing permissions in Vista/Windows 7 (I still don't know how to turn this off, it even denies acces when I try to acess it as an administrator mad ). But the strange thing is: If your script is in C:\programm files (or program files(x86) or whatever), how have you been able to create your script there in the first place?
© 2023 lite-C Forums