(48) SORTDIR, SORTALL
|
05-15-2014, 06:19 PM
Post: #1
|
|||
|
|||
(48) SORTDIR, SORTALL
A couple more 48 tools. To run these on an S/SX, you'll need to install replacements for DOLIST and SORT.
These two programs automate alphabetizing your variables, either for a single directory, or the entire directory tree (or just a subset of it). Both programs are commented and include headers for ASCII transfer if you want to load them that way, but they're both short enough to key in as well. On my 48GX, which is only modestly loaded with junk, the whole process takes a couple minutes to run (mostly because the ORDER command seems to be very slow). SORTALL This program recursively calls itself in every subdirectory beginning with the current directory (depth-first), then runs SORTDIR to sort the variable list as it passes through each directory. So if you run it from within HOME, you'll generally get a fully sorted directory tree. (I say generally, because it doesn't touch the hidden directory, and you can customize the sorting behavior per directory.) You'll probably want to store this in HOME so it can be called everywhere. Input: None (just switch to the correct directory first) Output: None (some status messages are displayed while executing) Code: %%HP: T(3)A(D)F(.); SORTDIR This program does the actual sorting, and should be stored in HOME. You can customize the sorting behavior beneath any specific directory by creating a new SORTDIR within any directory. If you create a custom version, it must run with no stack inputs, and should avoid leaving any stack output to prevent weird DOLIST artifacts. The default version given here sorts variables with directories listed first alphabetically, followed by programs listed alphabetically. The remaining variables are left unsorted at the end of the list to reduce run time. Input: None (switch to the desired directory first) Output: None (status messages will be displayed while running) Code: %%HP: T(3)A(D)F(.); |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)