Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-29-2008, 08:34 PM
TheStan TheStan is offline
Stan?
Join Date: May 2008
Location: U.S.
Posts: 100
TheStan is on a distinguished road
Send a message via AIM to TheStan Send a message via MSN to TheStan
File Functions

Recently, I found a need for a few quick access file functions. They may or may not help you but I thought it would be helpful to release to the public.

I replaced the percent signs with "#" signs. For the problem with the request error.

PHP Code:
public function getfolder(folder) {
  
temp.folder.loadfolder(folder "*"0);
  return 
temp.folder;
}
public function 
getfilelines(file) {
  
temp.lines.loadlines(file);
  return 
temp.lines;
}
public function 
getfilevars(file) {
  
temp.vars = new TStaticVar();
  
temp.vars.loadvars(file0);
  return 
temp.vars.getdynamicvarnames();
}
public function 
garbagecollect(foldfiletype) {
  
temp.folder null;
  
temp.null;
  
temp.file null;
  
  
folder.loadfolder(format("#s*.#s"foldfiletype), 0);
  echo(
folder);
  for (
ffolder) {
    if (
filesize(format("#s#s"foldf)) < 1) {
      
//deletefile(folder @ f);
      //deletefile(f);
    
}
    else {
      
file = new TStaticVar();
      
file.loadvars(format("#s#s"foldf));
      
      if (
file.getdynamicvarnames().size() < 1) {
        
//deletefile(folder @ f);
        //deletefile(f);
      
}
    }
  }

Determine whether or not you like the code through the reputation.
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 08:55 AM.


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