General discussion


Download: Reclaim gigabytes by deleting files

By Mark W. Kaelin Editor ·

Listing files on a hard drive, sorted by size, is not as simple as it sounds. The referenced download automated the process using Rexx scripts. Do you have a similar script for accomplishing this task? We'd like to see it. What scripting language do you use?

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -


by jmgarvin In reply to Download: Reclaim gigabyt ...

You can do a simple script in VB to list drive contents and sort by size.

Collapse -

Can we start with

by Tony Hopkinson In reply to Download: Reclaim gigabyt ...

TR downloads, the way they are multiplying, I'm going to have to buy another drive.

Collapse -

no more downloads! HTML!

by stat geek In reply to Can we start with

Downloading a PDF should be optional, but the format of the article should be HTML. Nuff said.

Collapse -

Very inconvenient

by doulos8 In reply to Download: Reclaim gigabyt ...

The article could have been in html instead of pdf.
The script can be copied from the pdf, but there are no carriage returns.

So, how does the script run? Well, after I muck around reformatting it, and then saving it with a .rex extension, it may run automatically in the regina interpreter I downloaded. I'm just guessing, since the article doesn't seem to describe how to actually RUN the script.

And TR, the hoops that you make us go through to read about a download, do the download, rate the download, and then get back to comment on it -- sheesh, do you think we've got all day. Your downloads are very user-unfriendly!

Collapse -

But it works - with a bit of help

by doulos8 In reply to Very inconvenient

Well, I didn't recover gigbytes of space, but the script does what it's supposed to - which is why I downloaded it. And spent the time making it work:

1. Unlike the example in Listing B, the DIR command returns time in a single field, like 07:42p. So,

parse value line with date time am_pm size name

needs to be

parse value line with date time size name

Otherwise, the "format" function gets a file name instead of a file size.

2. 'wordpad' is not a recognized command, unless you provide a path (or if it's in your PATH). I used

'"C:\Program Files\Windows NT\Accessories\wordpad"' out_file /* Let user view the big files */

3. Then it appeared that files were being list multiple times. The sort_in file needs to be deleted or cleared before you start writing to it. I added this after the 'dir' command:

'del ' sort_file out_file /* Clear any existing output file */

Overall, a nice introduction to Rexx. (Reminds me a bit of awk from my Unix days.) A helpful little script. But not a real slick download.

Collapse -

Rexx is great

by RimaDog In reply to But it works - with a bit ...

Great, quick-and-dirty way to extend the power of the standard utilities. Rexx is rich in built-in functions, good for handling strings, and runs almost everywhere. I've been using it on the mainframe for years. Best of all, it's easy to learn.

Collapse -

REXX on Windoze?

by AlanGeek In reply to Rexx is great

Don't get me wrong, I like REXX a lot, supported OS/2 for over 13 years, but I didn't think REXX was common on Windoze. I thought you had to purchase it to have it available. Am I mistaken? If it's in there, I'll start making much more use of it.

Collapse -

Sorry, hadn't read the stupid PDF

by AlanGeek In reply to REXX on Windoze?

Sorry, I hadn't downloaded the stupid PDF file. What's the reasoning behind everything being a PDF instead of just putting the darn thing in HTML? It's just a waste of time and a pain in the butt!

Collapse -

Rexx on Windows is Free !

by Foster2 In reply to REXX on Windoze?

There are several Rexx interpreters available for free download for Windows. All meet the international Rexx standards, plus have extra functions and features just for Windows.

Free Rexx Interpreters:
Regina -
Reginald -
Open Object Rexx -
r4 and roo! -

There are also over 100 free tools and interfaces for Rexx, most of which run on Windows.

The Rexx book at goes into the differences between the products in detail.

Collapse -

Code Improvements

by Foster2 In reply to But it works - with a bit ...

Great point about the need to erase the output files. Otherwise the script gives correct results on the first run but accumulates info in the output files on subsequent runs.

Wordpad must be in your command path or you must add it. Or, change the script to issue a fully-qualified command, as you've shown.

As the article says "... you'll get a slightly different file list from the DIR command depending on which switches you use and your version of Windows." The output listing shown is for the command 'dir c /-c /s' from the Windows XP sp 1 command processors.

Thanks for your improvements and feedback.

Related Discussions

Related Forums