=:The OpenVMS Frequently Asked Questions(FAQ)C

The OpenVMS Frequently Asked Questions(FAQ)



 r \ ^  
PreviousContentsIndex




3

Chapter 9
Files


U

9.1 How can I undelete a file?



GOpenVMS doesn't have an "undelete" function. However, if you Hare quick to write-protect the disk or if you can guarantee that no new Hfiles get created or existing files extended, your data is still on the Gdisk and it may be possible to retrieve it. The FLORIAN tool available Efrom various websites can potentially recover the file, see question gSection 13.1 for pointers. Other alternatives here include the DFU <tool, available on the OpenVMS Freeware CD-ROM distribution.

HIf you are setting up a user environment for yourself or for others, it Bis quite easy to use DCL to intercept the DELETE command, using a symbol:

 

"
&$ DEL*ETE :== @SYS$LOGIN:MYDELETE.COM 




FThe DELETE symbol will cause the procedure to be invoked whenever the Auser enters the DELETE command, and it can copy the file(s) to a D"trashcan" subdirectory before issuing a "real" HDELETE on the files. Other procedures can retrieve the file(s) from the F"trashcan" subdirectory, and can (and should) clean out the F"trashcan" as appropriate. (Realize that this DELETE symbol Acan interfere with DELETE/GLOBAL and other similar DCL commands.)u

9.2 Why does SHOW QUOTA give a different answer than DIR/SIZE?



HDIRECTORY/SIZE doesn't take into account the size of file headers which Hare charged to your quota. Also, unless you use DIRECTORY/SIZE:ALL, you Gwill see only the "used" size of the file, not the allocated Gsize which is what gets charged against your quota. Also, you may have files in other directories.

 

"
)$ DIRECTORY/SIZE=ALL/GRAND [username...] 7Grand total of D1 directories, F1 files, B1/B2 blocks. +$ DIRECTORY/SIZZ=ALL/GRAND [-]username.DIR 2Grand total of 1 directory, 1 file, B3/B4 blocks. 
$ SHOW QUOTA 1User [username] has B5 blocks used, B6 available >of B7 authorized and permitted overdraft of B8 blocks on disk 




GIf the user has no files in other directories and all file-headers are .only 1 block, then the following should apply:

 

"
  B5=B2+B4+F1+1 




>If the diskquota has drifted out of synchronization, then the Gsystem-manager can force a quota rebuild---due to various factors, the Fquota file can potentially drift from the actual use over time, and a ;periodic rebuild can be performed at appropriate intervals.

GAlso be aware that the DIRECTORY/SIZE command can report larger values Dthan might otherwise be expected when used to evaluate files and/or Gdirectories that are alias links---such as the system roots on OpenVMS Fsystem disks---as the command reports a total that is cumulative over Dall of the files and directories examined, without regard for which Bones might be alias entries and which are not. (In other words, a CDIRECTORY/SIZE of an entire OpenVMS system disk will report a disk Guseage value larger than the (usually more accurate) value reported by Gthe SHOW DEVICE command. This as a result of the alias entries linking >each SYS$SYSDEVICE:[SYSCOMMON]SYS*.DIR directory file and the 4SYS$SYSDEVICE:[000000]VMS$COMMON.DIR file together.)u

9.3 How do I make sure that my data is safely written to disk?



FIf your application must absolutely guarantee that data is available, Dno matter what, there's really no substitute for RMS Journaling and Ehost- or controller-based shadowing. However, you can achieve a good Gdegree of data integrity by issuing a SYS$FLUSH RMS call at appropriateCtimes (if you're using RMS, that is.) If you're using a high-level Elanguage's I/O system, check that language's documentation to see if Fyou can access the RMS control blocks for the open file. In C you can use fflush followed by fsync.

@For details on disk bad block handling on MSCP and on SCSI disk 6devices, please see Ask The Wizard (ATW) topic (6926).



WFor additional information, please see Section 3.9.v

9.4 What are the limits on file specifications and directories?



HA file specification has an aggregate maximum size of 255 characters at Gpresent. The node and device specification may be up to 255 characters Feach - file name and file types may be up to 39 characters each. File Aversions are from 1 through 32767, though 0 (latest version), -0 D(oldest version) and -n (n'th previous version) can be used in most Hcontexts. A file specification may not have more than 8 directories and Bsubdirectories - while it is possible to create subdirectories of Dgreater depth, accessing them is problematic in most cases and this should be avoided.

HApplication developers should use OpenVMS-supplied routines for parsing Efile specifications - this ensures that changes in what is allowable Hwill not tend to break your application. Consider that various parts of Gthe file specification may contain quoted strings with embedded spaces Cand other punctuation! Some routines of interest are SYS$FILESCAN, BSYS$PARSE and LIB$TRIM_FILESPEC. For further information, see the #OpenVMS Guide to File Applications.

FPerformance of larger directory files improves (greatly) with OpenVMS HV7.2 and later---operations on directory files of 128 blocks and larger Gwere rather slower on earlier OpenVMS releases due to the smaller size Eof the directory cache and due to the directory I/O processing logic.

FFor fastest directory deletions, consider a reverse deletion---delete Gfrom the last file in the directory to the first. This reversal speeds Hthe deletion operation by avoiding unnecessary directory I/O operations Eas the files are deleted. Tools such as the Freeware DFU can be used for this purpose,?as can various available reverse-DELETE DCL command procedures.s

9.5 What is the largest disk volume size OpenVMS can access?



GOne Terabyte (TB; 2**31 blocks of 2**9 bytes; 0x07FFFFFFF blocks). 255 Hvolumes in a volume set. The largest contiguous allocation possible for *any particular file is 0x03FFFFFFF blocks.

EPrior to the release of V6.0, the OpenVMS file system was limited to @disk volumes of 8.38 GB (2**24 blocks, 16777216 blocks) or less.

DOn some systems, there are restrictions in the console program that Hlimit the size of the OpenVMS system disk. Note that data disks are not Daffected by console program limits. For example, all members of the VAXstation 3100Cseries are limited to a system disk to 1.073 GB or less due to the /console, though larger data disks are possible.

ESome SCSI disks with capacities larger than 8.58 gigabytes (GB) will Grequire the use of an OpenVMS ECO kit (eg: ALPSCSI04_062 or later) for Enew SCSI device drivers. Failure to use this ECO can cause "rounding Derrors" on the SCSI disk device capacity---OpenVMS will not use nor Hdisplay the full capacity of the drive---and "%sysinit-e-error mounting Hsystem device status equals 000008C4" (8C4 -> "%SYSTEM-?-FILESTRUCT, Aunsupported file structure level") errors during bootstrap. (One Eworkaround for the bootstrap when the bitmap is located far into the Ddisk is the use of INIT/INDEX=BEGIN.) The problem here involves the Gparticular extensions and fields used for larger capacity disks within Fthe SCSI specifications and within the various intepretations of same.

For IDE disk drives:



dSee Section 14.21 for additional IDE SYS$DQDRIVER information.

CBe aware that a known restriction in certain older versions of the EAlpha SRM Console prevents booting most IDE drives larger than 8.455 DGB, depending on exactly where the various files are located on the Hvolume. Updated SRM consoles for systems with SRM and IDE drive support ?are (will be) available. (OpenVMS Engineering has successfully Gbootstrapped 20GB IDE disks using the appropriate SRM console version.)

FNOTE: All IDE-related disk sizes listed in this section are stated in Dunits of "disk (base ten) gigabytes" (1 GB = 10^9 bytes) and NOT in Dunits of "software (base two) gigabytes" (1 GB = 2^30 (1073741824.) >bytes. See Section 14.44.

CBe aware that larger disks that are using an extension of SCSI-2---Fdisks that are using a mode page field that the SCSI-2 specifications Dnormally reserved for tape devices---to permit a larger disk volume Gsize will require a SCSI driver update for OpenVMS, and this change is Dpart of V7.1-2 and later, and also part of ALPSCSI07_062 and later. F(These larger disks disks will typically report a DRVERR, or will see Hthe volume size "rounded down".) SCSI disks larger than 16777216 blocks Fcira 8.455 GB (base ten); 8GB (base two) require this ECO, or require )the use of OpenVMS Alpha V7.1-2 or later.

HApplications written in C can be limited to file sizes of two gigabytes Band less, as a result of the use of longword values within C file Boperations, and specifically off_t. This restriction is lifted in EOpenVMS V7.3-1 and later, and with the application of the C ECO kits Cavailable for specific earlier releases. The use of a longword for Eoff_t restricts applications using native C I/O to file sizes of two Dgigabytes or less, or these applications must use native RMS or XQP calls for specific operations.

nAlso see Section 14.27, Section 14.44.x

9.6 What is the maximum file size, and the RMS record size limit?



ERMS can store individual files of a size up to the maximum supported Gvolume size. Under OpenVMS V6.0 and later, the volume size and the RMS Cmaximum file size limit is 2**31 * 512 bytes---one terabyte (1 TB).

C"Use a volume set to provide a large, homogeneous public file Hspace. You must use a volume set to create files that are larger than a Fsingle physical disk volume. (The file system attempts to balance the Cload on the volume sets, for example, by creating new files on the 1volume that is the least full at the time.)"

E"You can add volumes to an existing volume set at any time. The 7maximum number of volumes in a volume set is 255."

EThe RMS formats---sequential, relative, and indexed---are limited by Ethe one terabyte maximum volume size. RMS relative files are further Dlimited to a number of records that will fit in 32 bits---4 billion Crecords. Sequential and indexed formats do not have a record limit.

pAlso see Section 10.13, Section 14.44.p

9.7 How do I write recordable CD media (CD-R) on OpenVMS?



AAt its simplest: get LDDRIVER from the Freeware. Get CDRECORD or ECDWRITE. (CDRECORD and CDWRITE are freely available, though versions are not on theBFreeware V5.0 distribition; the URLs are referenced later in this Esection). Build the contents of the disk on the LD device partition. GThen use the CDRECORD or CDWRITE tool to record the contents of the LD 0partition directly onto the CD-R or CD-RW media.

GWhile folks have had success getting PC-based CD-R/CD-RW tools to work Gwith OpenVMS partitions, it is far easier and more reliable to use the $OpenVMS-based versions of the tools.

CMore details: Creation of CD-ROMs using CD-Recordable media (CD-R) Gunder OpenVMS typically involves one of two approaches: the use of the Foptional CD-R (`Scribe') capabilities available for the InfoServer or Fother "offline" hardware packages (PC-based packages will be included Gin this), or the use of a host-based package such as the CDWRITE13_VMS )utility, an OpenVMS port of a Linux tool.

FOpenVMS presently has no integrated support for recording CD-R media, Hthough this is expected to change in a release after OpenVMS Alpha V7.3.

6OpenVMS can read both ODS2 and ISO9960 format CD-ROMs.

HInfoServer hardware configurations are no longer available from HP, but 0may potentially be acquired through other means.

FThe CDWRITE13_VMS package is one example of a host-based package that Gcan be used to create CD-R media. The contact for CDWRITE13_VMS is Dr. DEberhard Heuser-Hofmann. One website that discusses this package is located at:

 

"
@http://www.geocities.com/SiliconValley/Lakes/9999/vmscdwri.html 




;Additional information is available at the following sites:



BU.S. Design offers a package that includes the tools necessary to Ecreate a CD or DVD-R with either 9660 or ODS-2 format, for standalone?CD-R or DVD-R drives, for recent OpenVMS versions. Details are available at:

j

9.8 What I/O transfer size limits exist in OpenVMS?



HThe maximum transfer size is an attribute of the particular I/O device, Fcontroller and driver combination; there is no inherent limit imposed Fby OpenVMS (other than the fact that, today, byte counts and LBNs are generally limited to 32 bits).

DThe maximum size of a device I/O request is limited by the value in BUCB$L_MAXBCNT, which is set by the device driver based on various Dfactors. (Also check the setting of the MAXBUF system parameter for 6buffered I/O transfers, and check the process quotas.)

ECurrently, SCSI drivers limit I/O transfers to FE00(16) bytes, 65024 Cbytes (decimal). The reasons for this transfer size limitation are Dlargely historical. Similarly, DSSI devices are limited to the same Dvalue, this for hardware-specific reasons. Transfers to HSC and HSJ Edevice controllers via the CI are limited to 1,048,576 bytes. Client EMSCP-served devices are limited to 65535 bytes---to help ensure that Fthe I/O fragmentation processing happens on the client and not on the server system.

DParts of the OpenVMS I/O subsystem are optimized for data transfers <less than 64KB, because (obviously) most I/O operations are H(substantially) less than that. OpenVMS can handle larger transfers, if (the driver and the device can handle it.

jAlso see Section 9.4, Section 9.5.o

9.9 Can I use ODBC to connect to OpenVMS database files?



DYes, you can use various available third-party packages that permit ?remote ODBC clients to access RMS files and various commercial databases via the network.

?For RMS, consider acquiring one of the packages available from EEasySoft, Attunity Connect (formerly known as ISG Navigator), Oracle +(DB Integrator), SolutionsIQ, and Synergex.

GFor specific commercial databases (other than RMS, of course), contact ,the database vendor directly for assistance.


M

Chapter 10
OpenVMS Programming Information


`

10.1 Can I have an example of calling...?



HPlease use the available SEARCH command on OpenVMS, and please remember Gto search the available resources, including the support databases and Ethe newsgroup archives. Please also realize that most OpenVMS system Cservices use similar calling sequences, meaning that an example of @calling sys$getjpi can be used as an example for sys$getsyi and >sys$getdvi. Students: please do not expect folks to write your*homework for you. As for search resources:



BOpenVMS programming documentation, including the numerous example Aprograms found in recent versions of the OpenVMS Programming #Concepts manual, is available:



EAs for details of argument passing, most OpenVMS system services and BRTL routines pass string arguments by descriptor. Languages which Csupport native string data types create descriptors automatically; Ethose which do not (eg., C) require that you set them up explicitly. DFor further details on using descriptors and particularly for using Rdescriptors from C, please see Section 10.12.

GThere is extensive information available on how to call OpenVMS system Fservices and OpenVMS Run-Time Library routines, including examples in <numerous languages. Among the best available references are:



DIn addition, if you are a subscriber to the HP Software Information CNetwork (available to those with a software support contract), the Hsupport database contains hundreds of worked examples of calling system Cservices and RTL routines, including the one that seems to trip up !almost everyone, SMG$CREATE_MENU.

DArne Vajhøj has put together a collection of OpenVMS example programs. It can be found at:



BAdditional information and examples for OpenVMS are available via:



WFor additional information, please see Section 3.9.and via:

m

10.2 How do I get the arguments from the command line?



HIf you're writing a program and want to accept arguments from a foreign Gcommand, you can use LIB$GET_FOREIGN to get the command line and parse Eit yourself, or if you're programming in C, use the normal argc/argv method.

2To write an application which uses the normal DCL Gverb/qualifier/parameter syntax for invocation, see the description of Ethe CLI$ routines in the OpenVMS Callable Utility Routines Reference Manual.

GIt is possible to write an application which can be used both ways; if Fa DCL verb isn't used to invoke the image, the application parses the Gcommand line itself. One way to do this is to call CLI$GET_VALUE for a required<parameter. If it is not present (or you get an error), call @LIB$GET_FOREIGN to get the command line and do the manual parse.

See also reference>(DCL1).q

10.3 How do I get a formatted error message in a variable?



EUse the SYS$PUTMSG system service with an action routine that stores Gthe message line(s) in the variable of your choice. Be sure the action Aroutine returns a "false" (low bit clear) function value so that SYS$PUTMSGEdoesn't then try to display the message (unless you want it to.) See Gthe description of $PUTMSG in the System Services Reference Manual for &an example of using an action routine.x

10.4 How do I link against SYS$SYSTEM:SYS.STB on an Alpha system?



GLINK/SYSEXE is the OpenVMS Alpha equivalent of linking against SYS.STB.5This links against the base image: SYS$BASE_IMAGE.EXE

iAlso see Section 10.10, particularly for pointers to the details on .shareable images and shareable image creation.l

10.5 How do I do a SET DEFAULT from inside a program?



EThe problem is that SYS$SETDDIR only changes the default directory - DNOT the default disk. The default disk is determined by the logical HSYS$DISK. If you want to change the default disk within a program, then Fcall LIB$SET_LOGICAL to change the logical SYS$DISK. You will need to Fcall both LIB$SET_LOGICAL and SYS$SETDDIR to change both default disk and the default directory!|

10.6 How do I turn my Fortran COMMON into a shareable image on Alpha?



BYou need to add SYMBOL_VECTOR=(<common-name>=PSECT) to your Goptions file. On OpenVMS VAX all OVR/REL/GBL psects were automatically Dexported into the shareable image's Global Symbol Table. On OpenVMS FAlpha you have to tell the linker that you want this done by means of >the PSECT keyword in the SYMBOL_VECTOR options file statement.

GThis has several advantages over OpenVMS VAX. First, you don't have to Cworry about the address of the psect when you try to create a new, Dupwardly compatible version of the shareable image. Second, you can Econtrol which psects, if any, are made visible outside the shareable image.

FBy default, COMMON PSECTs in HP Fortran for OpenVMS Alpha (as well as Gmost other OpenVMS Alpha compilers) are NOSHR. On VAX, the default was FSHR which required you to change the attribute to NOSHR if you wanted Cyour COMMON to be in a shareable image but not write-shared by all ;processes on the system. If you do want write-sharing, use:

 

"
CDEC$ PSECT common-name=SHR 




Fin the Fortran source code (the CDEC$ must be begin in column 1) or a Alinker options file PSECT_ATTR statement to set the COMMON PSECT attribute to SHR.

/For further information, see the Linker manual.




 r Y \ ^  
PreviousNextContentsIndex