Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   File Functions (https://forums.graalonline.com/forums/showthread.php?t=80300)

TheStan 06-29-2008 08:34 PM

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. :)

projectigi 06-29-2008 09:05 PM

uh what about the last function?
echo?
commented out delete file? o.o

Tigairius 06-29-2008 11:07 PM

Uh, okay? Always nice to have more code gallery additions :) It's not worth repping though.

TheStan 06-29-2008 11:57 PM

Quote:

Originally Posted by projectigi (Post 1400087)
uh what about the last function?
echo?
commented out delete file? o.o

I commented out delete file because I'm not sure which one is the proper way, with the filepath or just the file name.

Quote:

Originally Posted by Tigairius (Post 1400105)
Uh, okay? Always nice to have more code gallery additions :) It's not worth repping though.

Lmao, rightyo Tig.


All times are GMT +2. The time now is 03:36 PM.

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