[Info-vax] OpenVMS - DCL - Data entry filtering
Stephen Hoffman
seaohveh at hoffmanlabs.invalid
Fri Mar 27 14:32:59 EDT 2015
On 2015-03-27 17:51:59 +0000, JF Mezei said:
> In ALL-IN-1, there was a very neat function called...
Most any competent programming environment has something similar
nowadays. In many ways, DCL is stuck in the past. But there is an
option here, even for DCL.
> make_file_name("string")
In traditional C, some of the common choices are mkdtemp, mkstemp,
mkstemps and mktemp. mkstemp is handy, because it also opens the file
for you. confstr is also used here in some environments, but VMS
doesn't AFAIK have a mechanisms available to fetch the default TMP area.
OS X and iOS Cocoa programmers often use NSTemporaryDirectory and related.
Python programmers use Lib/tempfile.py or such, and with various calls
including an in-memory option.
Fortran has its SCRATCH status.
Even DCL has the f$unique lexical, though having something akin to OPEN
with /TEMPORARY [/ERASE_ON_DELETE] might be handy. (Waiting for CLOSE
/DISPOSITION is not without some considerations.)
> Basically, you gave it some string and it ensured it was within syntrax
> of the file system. If no string supplied it generated those wonderful
> random letter ZWYUEYDNDS.WPL file names.
In many configurations, there are also security implications and there
are often disposal requirements for temporary files, too.
> It makes for much cleaner code rather than having to roll your own
> string scanning and character replacement routines to create file names.
And having to verify that the generated name does not already exist, etc.
> For a DCL variant, specifying the device name could verify file system
> type and create the file name according to that file system's
> capabilities. (otherwise, assume ODS-5)
ODS-2 is dead. No new features and no feature- or support-downgrades
to ensure compatibility with ODS-2. New work should target ODS-5
only, or some later file system if and as available.
--
Pure Personal Opinion | HoffmanLabs LLC
More information about the Info-vax
mailing list