Page 1 of 1

Compression Utility Request

Posted: Mon Jan 05, 2009 10:11 pm
by jsc
David,

Any chance of providing a small utility or functionality to compress grf files to grfz in batch mode? Would come in handy.

Might like option to keep file dates same as the file converted, and an option to blow away the original uncompressed file after conversion.

Recursing subdirectories might also be nice, but not as necessary.

Doesn't have to be pretty. A standalone command line version would do well enough. Maybe could work within a DPlot "convert" or "save as" dialog.

Thanks.

Jon

Posted: Mon Jan 05, 2009 11:01 pm
by DPlotAdmin
Jon,
Good idea for when I have some breathing room, thanks. In the meantime, I assume you know you can already do the conversion with a macro:

ForFilesIn("*.grf")
FileSaveAs(15,".grfz")
FileClose()
NextFile


This won't preserve file dates (actually I think that might be an insurmountable problem on Vista, not sure) or delete the originals, but it will perform the primary task that you're interested in.

Posted: Mon Jan 05, 2009 11:22 pm
by jsc
I think you posted that macro before - I should have known! :oops:

Will go that way for now.

And Happy New Year! (I hope!!!!)

Posted: Tue Jan 06, 2009 11:29 am
by jsc
"Illegal file type code in FileSaveAs() command." using FileSaveAs(15,".grfz") exactly as you have it. (I did add a "Directory()" command to put DPlot into the correct directory as a first command.)

Also, the way I'm reading the help file, I'm thinking that there is no easy way to save the file with the same file name if the file name is not the same as the plot title. I tried:

FileSaveAs(15,"|FILENAME|.grfz")

and I get an "Unrecognized replaceable parameter |FILENAME|" error, but this time no "Illegal file type" message.

This was with one of the plots showing in DPlot.

When I closed all open plots and then tried to run the macro, nothing happened (that I could see!).

Any ideas?

Thanks.

Posted: Tue Jan 06, 2009 1:55 pm
by DPlotAdmin
D'oh!

The "Illegal file type" error message is generated by the macro editor, which hasn't kept up with dplot.exe. Sorry for the trouble. This is fixed. I'll most likely be posting an update tomorrow (1/7) after cleaning up a few other odd problems.

|FILENAME| doesn't work in a loop - I'll probably add that sooner or later, but if you simply want to use the same filename there's no need for this; just use (after tomorrow)

FileSaveAs(15,".grfz")

or

FileSaveAs(15,"")

In either case the path and filename will be the same. For the latter case, the default extension .grfz for that type will be used.

Posted: Tue Jan 06, 2009 10:40 pm
by jsc
Will watch for update. Thanks as always!

Jon