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(file, 0);
return temp.vars.getdynamicvarnames();
}
public function garbagecollect(fold, filetype) {
temp.folder = null;
temp.f = null;
temp.file = null;
folder.loadfolder(format("#s*.#s", fold, filetype), 0);
echo(folder);
for (f: folder) {
if (filesize(format("#s#s", fold, f)) < 1) {
//deletefile(folder @ f);
//deletefile(f);
}
else {
file = new TStaticVar();
file.loadvars(format("#s#s", fold, f));
if (file.getdynamicvarnames().size() < 1) {
//deletefile(folder @ f);
//deletefile(f);
}
}
}
}
Determine whether or not you like the code through the reputation.