Graal Forums  

Go Back   Graal Forums > Graal V6 forums > Feature request
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-29-2008, 08:59 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
hasscriptaccess()

hasscriptaccess(filepath, readonly) - returns true if the file at the given filepath can be accessed with the various load/save functions such as loadlines(). readonly is a bool that is true if you only want to check if the file can be read regardless of if you can write to it.


Example:
PHP Code:
//#CLIENTSIDE
function onCreated() {
  if (
hasscriptaccess("Graal.exe"1))
    echo(
"I have script access to Graal.exe");
  else
    echo(
"I do not have script access to Graal.exe");

Would echo "I do not have script access to Graal.exe".

PHP Code:
//#CLIENTSIDE
function onCreated() {
  if (
hasscriptaccess("scriptfiles/" servername "/newfile.nw"1))
    echo(
"I have script access to newfile.nw");
  else
    echo(
"I do not have script access to newfile.nw");

Would echo "I have script access to newfile.nw".

Of course on the clientside the second parameter would only check if the file was read-only or not.

The function should also be supported serverside which would basically return the (npcserver)'s hasfolderright() to the file with respect to r and rw depending on the second parameter.

What do you think, could you implement this function Stefan? Really would like it for my global client/server file browser I'm making (which is required for my scripted level editor) as well as a few other things.
__________________
Do it with a DON!
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:32 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.