resize command

The resize command resizes a file to the preferred modulo, and increases or decreases the apparent contiguous portion (or modulo) of the specified file without requiring a file-restore. It either adds or releases the amount of overflow necessary to reach the new modulo and rehashes all of the items. The rehashing is done by groups and the current relative group being rehashed displays on the screen.

For Windows: Not Supported in FSI.

See the nt_resize command for an alternate resize method.

Syntax

 resize file.reference {modulo} {(options}

Synonym(s)

 resize-file

Parameter(s)

options a Allocates new file space only.

If this option is used, then the new segment is added, but no items are rehashed. This is useful for allocating the new file space in the foreground, and then starting another resizing process as a phantom to complete the rehashing process.

s Suppresses output of the relative group counter during rehashing.
u Unconditional resizing.

Typically, resizing processes pause temporarily when some other process is accessing the file in a sequential fashion. For example, a save, an AQL, or FlashBASIC select. This is because items are in motion during the resizing and sequential processes might find an item twice.

The u option disables this behavior so that resizing proceeds irrespective of any sequential processes. Also, the u option releases extra unused file space at the end of a resize down irrespective of how many users have that file open.

w{n} Waits after every group.

If a numeric parameter is not specified, then this option causes the resizing process to wait for approximately 100 milliseconds between each group that it rehashes.

If an optional numeric parameter is specified, then the process sleeps for n seconds between each group. This option minimizes the impact on overall system performance during the resizing process and is strongly recommended.

z Rehashes a small number of groups only.

This is used by the check-resizing and kill-resizing commands after a resizing process has been terminated unexpectedly.

Under these conditions, the resize command processes enough groups to assure that no duplicate items occur in groups which were previously being rehashed.

Description

The resize command allows a file to be read or modified while the items are being rehashed. The resizing process does not require a completely new block of overflow with a size equal to the new modulo. Instead, it allocates a new file segment, which is only as big as the difference between the old and new modulos, and maps this segment onto the existing file. The file then displays to have one contiguous block available even though it might really be several blocks internally.

Note: A file cannot be resized to a modulo smaller than the modulo assigned when the file was originally created.

When a resizing command has begun rehashing a file, the command can be logged-off or interrupted without problems. The resizing process can then be restarted on the same line or on a phantom.

If the modulo is not specified, then the resize command resizes the file according to the reallocation attribute in the file’s D-pointer.

These commands perform the following actions:
  • The list-resizing command: Displays all resizing processes currently active.
  • The kill-resizing command: Temporarily stops all resizing processes on the system.
  • The check-resizing command: Restarts all resizing processes (on phantoms).

    This command is executed at coldstart time to restart any resizing commands that were interrupted by a shutdown.

After resizing a file, the D-pointer of that file displays a modulo equal to the new modulo. The reallocation attribute is also changed to the new modulo. The internal base and modulo of each of the file’s segments display in the segment-base and segment-mod attributes. These attributes cannot be modified.

Warning:

Since files can now be made up of multiple segments, it is no longer valid to assume that the base plus the modulo in the file’s D-pointer points to the FCB.

To find the FCB, add the base and the modulo of the first segment. This formula is not guaranteed on future releases.

Resizing processes occasionally pause during the rehashing phase because items cannot be moved while another user is accessing the same file in a sequential manner.

When resizing processes pause, you will see this message:
 Pausing for another process doing sequential file access..
  • Due to their long-running time and lack of effect on actual data, resizing commands are not transferred to the transaction log.
  • It is not possible to resize the mds file. However, the file-of-files file can be resized.
  • On a specified file, it is not possible to resize to a new modulo until the previous resizing (if any) has completed.

When resizing downwards, it is sometimes not possible to release the extra file space if another user has that file open. In this case, all users must close the file before the space can be released. When all users have closed the file, re-execute the resize command to release the space.

VME type files

The resize command resizes VME type files. When you specify a file reference parameter that is a q-pointer to the actual file, the resize command builds a file reference path to the real file. For example: account, dictname, dataname.

When performing a resize on file contained in a VME type account, the resize BASIC program command calls the :resize command to process the resize operation. The only user interface difference is that the file reference parameter is changed to the file reference path parameter.

FSI type files and nt_resize command

When using the resize command on a file contained in an FSI account, the resize BASIC program calls the nt_resize BASIC program command. The nt_resize command supports a different format, and a different selection of parameters and options, than the resize BASIC program. Therefore, the resize command parameters and options must be converted to the format supported by the nt_resize command.

For FSI type files, the only option that is supported by the resize BASIC program is the s option for suppressing output. This option is converted to the nt_resize command -q option (for QUIT mode). All other resize command BASIC program options are ignored and not transferred when executing the nt_resize command.

If you want to specify the parameters and options of the nt_resize command, then you should call nt_resize directly, rather than using the resize command.

The following are the only options that are automatically enabled when the resize command BASIC program calls the nt_resize command:
  • -c no: No check for errors before resize process is initiated.
  • -i: Starts the resizing in Immediate mode and cannot be stopped. The resize operation runs in the foreground.

Example(s)

Assume that a file called mydata exists with a modulo of 7, and that the istat command indicates a suggested modulo of 13.

 resize mydata 13
 Allocating 6 additional frames for primary file space.
 Rehashing 7 group(s).
 7
 [188] Resizing complete.

The file now exists with a modulo of 13.