Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-30-2007, 08:25 PM
Luigi203 Luigi203 is offline
Hamma Time
Luigi203's Avatar
Join Date: Mar 2003
Location: North East PA
Posts: 285
Luigi203 is on a distinguished road
Send a message via AIM to Luigi203
fileexists

Whats the deal with fileexists()? Is it just not working correctly? This is starting to annoy me..

PHP Code:
function PosseExistsgetfile) {
  return 
fileExists("documents/posses/" getfile ".arc");


No matter what I try, fileExists() constantly returns false.
__________________


CAUTION
Reply With Quote
  #2  
Old 04-30-2007, 08:39 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Ask yourself it the file exists!
Reply With Quote
  #3  
Old 04-30-2007, 08:46 PM
Luigi203 Luigi203 is offline
Hamma Time
Luigi203's Avatar
Join Date: Mar 2003
Location: North East PA
Posts: 285
Luigi203 is on a distinguished road
Send a message via AIM to Luigi203
I know the file exists.. but the script doesnt :]
__________________


CAUTION
Reply With Quote
  #4  
Old 04-30-2007, 08:56 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
He's holding back, torture should get him to confess.
Reply With Quote
  #5  
Old 04-30-2007, 09:03 PM
Deadly_Killer Deadly_Killer is offline
Registered User
Join Date: Feb 2002
Posts: 227
Deadly_Killer is on a distinguished road
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;

__________________
- Zidane / Zidaya
Reply With Quote
  #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
  #7  
Old 05-01-2007, 09:14 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
I think it might have something to do with the folder configuration. Certain functions work or don't work outside of the levels/ folder.
__________________
Reply With Quote
Reply


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:50 AM.


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