Vice City: Multiplayer

VC:MP Discussion => General Discussion => Topic started by: KAKAN on Oct 12, 2015, 01:51 PM

Title: saving a file in a different location.
Post by: KAKAN on Oct 12, 2015, 01:51 PM
The topic says all^^.
I want to save a file in a different drive/folder.
For ex:-
I have my server is Drive D, but I want to read/write/create a file and update it in Drive C, in a folder 'A', is there any ways to do it?
Title: Re: saving a file in a different location.
Post by: Xmair on Oct 12, 2015, 01:54 PM
No, you must keep the file in your script folder.
Title: Re: saving a file in a different location.
Post by: MacTavish on Oct 12, 2015, 02:00 PM
Symlink.  Only @Thijn can explain about it
Title: Re: saving a file in a different location.
Post by: KAKAN on Oct 12, 2015, 02:13 PM
@Thijn, help me pl0x. This is needed for me.
Title: Re: saving a file in a different location.
Post by: DizzasTeR on Oct 12, 2015, 02:57 PM
All you need to do is give a complete route to the file / folder, it is possible.

dofile( "D:/myscript/scripts", true );
Title: Re: saving a file in a different location.
Post by: EK.IceFlake on Oct 12, 2015, 03:07 PM
This is not possible. The squirrel interpreter runs inside a virtual machine, meaning it is blind to any folder except the script folder. You can see an example by executing
system("dir /s");on a Windows machine. That command is supposed to print every file, but it only prints the files inside the script folder as it virtually doesn't exist in the VM. However it can be done using plugins.
Title: Re: saving a file in a different location.
Post by: DizzasTeR on Oct 12, 2015, 03:17 PM
@NE.CrystalBlue, Would you mind taking 5 minutes for testing something rather than wasting them to prove your logics? I've been doing that for quite a time now on my windows PC and it JUST WORKS. If it doesn't work for anyone else then I have nothing to say.

Edit: I've also tested it and it worked with databases connection as well.
Title: Re: saving a file in a different location.
Post by: KAKAN on Oct 12, 2015, 04:02 PM
Thanks. I'll test it, how can I save a file tho?
I'm using JSON plugin, will it work?
Title: Re: saving a file in a different location.
Post by: Thijn on Oct 12, 2015, 04:10 PM
TRY IT
Title: Re: saving a file in a different location.
Post by: EK.IceFlake on Oct 13, 2015, 12:27 PM
Quote from: Doom_Killer on Oct 12, 2015, 03:17 PM@NE.CrystalBlue, Would you mind taking 5 minutes for testing something rather than wasting them to prove your logics? I've been doing that for quite a time now on my windows PC and it JUST WORKS. If it doesn't work for anyone else then I have nothing to say.

Edit: I've also tested it and it worked with databases connection as well.
Well when I've tested, yes, tested, it, it only saw the files inside the folder.
Title: Re: saving a file in a different location.
Post by: DizzasTeR on Oct 13, 2015, 01:41 PM
Quote from: NE.CrystalBlue on Oct 13, 2015, 12:27 PMWell when I've tested, yes, tested, it, it only saw the files inside the folder.

I'm not talking about this...Geez

system("dir /s");
I'm talking about loading things in script.
Title: Re: saving a file in a different location.
Post by: EK.IceFlake on Oct 13, 2015, 02:03 PM
Yeah, plugin enabled functions will work fine. However, core squirrel functions wont work (system, fopen or something else, etc)