Thread: fileexists
View Single Post
  #6  
Old 04-30-2007, 10:22 PM
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
Quote:
Originally Posted by Deadly_Killer View Post
You may need to give the npc-server read rights to the file.

Anyway, here is a function which uses loadlines to check if a file exists.

PHP Code:
function fileexists2(file) {
  
temp.file.loadlines(file);
  
  if (
temp.file.length() > 0) {
    return 
true;
  }

  return 
false;

Ahh that's not true though because the file can still have 0 bytes and exist but your function would return false! It is better to do:
temp.file.size() > 0
__________________
Do it with a DON!
Reply With Quote