Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Methods for positioning and changing size

The getCurrentRecordNumber() method returns the current file position as a record number.

The setCurrentRecordNumber() method sets the current position of the file to the record with the specified number. The special constants POS_FIRST and POS_LAST can be used to position to the start or end of file.

The getRecordCount() method returns the number of records in the file. That is simultaneously the position of the end of file.

The setRecordCount() method modifies the size of the file to the number of records specified. If the specified number of records is less than the current number of records in the file, the file is shortened so that it only contains as many records as specified. If in this case the current file position was greater than the new file size, the current file position is set to the new end of file. If the specified number of records is greater than the current number of records in the file, the file can be extended. An access method can reject such a file extension, for example for files with variable record format. When the operation has been executed, the content of the newly added records is undefined.

Special features of the DMS file system

When shared update processing is used in the DMS file system, it is not possible to reduce the size of a file. This would trigger an IOException.

When shared update processing is used in the DMS file system, information on the current end-of-file cannot be synchronized between participating applications. Simultaneous extension of RandomAccessRecordFiles by several applications is not therefore recommended. Nevertheless, the locks are set as if the file were being extended by writing individual records on after the other.