saving a file in a different location.

Started by KAKAN, Oct 12, 2015, 01:51 PM

Previous topic - Next topic

KAKAN

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?
oh no

Xmair

No, you must keep the file in your script folder.

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

MacTavish


Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

KAKAN

oh no

DizzasTeR

All you need to do is give a complete route to the file / folder, it is possible.

dofile( "D:/myscript/scripts", true );

EK.IceFlake

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.

DizzasTeR

#6
@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.

KAKAN

Thanks. I'll test it, how can I save a file tho?
I'm using JSON plugin, will it work?
oh no

Thijn


EK.IceFlake

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.

DizzasTeR

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.

EK.IceFlake

Yeah, plugin enabled functions will work fine. However, core squirrel functions wont work (system, fopen or something else, etc)