New Message: list sorting
webmaster at userland.com
webmaster at userland.com
Thu Oct 25 20:58:49 PDT 2001
A new message was posted:
Address: http://frontier.userland.com/discuss/msgReader$9024
By: Dan Peters (dapeters at dallasnews.com)
There's got to be a better way to do this....
On my current project, the data was moved to a NAS server (Dell) running BSD. I've got many scripts that traverse the file system and build web pages with the output (flat file db).
The sort order of the directory structure isn't in alpha/date order.
What I'm currently doing is get the listing, stuff it into a temporary outline, sort the outline and then feed the result back to the main script. This seems like too much overhead. It's fairly slow. Anyone got any tips/tricks?
on listBuilder(path) {
local (workList = "");
on add (s) {
workList = workList + s + cr};
fileloop (f in path) {
if string.mid(file.filefrompath(f),1,1) != "." {
if file.isfolder(f) {
add (file.filefromPath(f))}}};
textAdr = ("raw_" + random (1,9999) + clock.ticks());
op.newOutlineObject (workList, @suites.pagetracker.diskbuilder.data.[textAdr]);
target.set(@suites.pagetracker.diskbuilder.data.[textAdr]);
op.sort();
target.clear();
workList = "";
workList = string(suites.pagetracker.diskbuilder.data.[textAdr]);
delete(@suites.pagetracker.diskbuilder.data.[textAdr]);
return (workList)}
This is a Manila site.. http://manila.userland.com/.
More information about the Frontier-Server
mailing list