4.13.23 Obtaining the file size
Function
This plug-in outputs the total size of all files, including subfolders, at the specified path to a property.
The path (file path or folder path) is specified by the common.targetPath property. The value of this property cannot include wildcard characters.
This plug-in outputs, to the property, both the total file size and the unit in which that size is given.
The unit in which the file size is given is specified by the common.fileSizeUnit property. For this property, you can specify "B", "KB", "MB", "GB", or "TB". If you specify a value other than one of these values, the plug-in terminates abnormally.
If the specified unit is not "B", the size will be calculated by using the base number 1024 (rather than 1000). For the fractional part, a maximum of two decimal places are output. Subsequent decimal places are truncated.
Use situation
This plug-in can be used to check the size of files or folders created by another plug-in.
Prerequisites
For the most recent information about the prerequisite products on the execution-target server, and the supported OSs on the execution-target server, see the Release Notes.
In addition, the following OS and products use abbreviations. For the abbreviations of OS and products, see the "Preface".
[Prerequisite products on the execution-target system]
None.
[Supported OSs on the execution-target server]
(1) Windows Server
(2) Red Hat Enterprise Linux Server
The bc package must be installed.
(3) Oracle Linux
The bc package must be installed.
[Conditions for using the execution-target server]
None.
Cautions
(1) For the properties of this plug-in, do not specify any strings that include double quotation marks (") or single quotation marks (').
(2) If the OS of the execution-target server is Windows and the target folder contains a file or subfolder that cannot be accessed (for example, because of access permission settings), this plug-in terminates abnormally.
(3) If the OS of the execution-target server is Windows and the target folder contains a symbolic link to a folder, this plug-in also obtains the size of the link-target folder. If the link-target folder is an upper-level folder, the plug-in terminates abnormally.
Version
02.00.00
Plug-in tags
Gather OS information,Windows,Linux
Plug-in name displayed in the task log
osMeasureFileSize
Return code
0: Normal
12: Error (Mistake by user) Invalid property
27: Error (Check with the task log about the error detail) Unidentified error
41: Error (An error has been detected in the plug-in) Property not entered (An error has been detected in the component script)
Property list
The following table lists the properties:
Property key |
Property name |
Description |
Default value |
I/O type |
Required |
---|---|---|---|---|---|
plugin.destinationHost |
Host name of the execution target server |
Specify the host name or IP address of the server on which this plugin will be executed. IPv6 addresses are not supported. |
-- |
Input |
R |
common.targetPath |
Target path |
Enter the full path of the target file or folder. |
-- |
Input |
R |
common.fileSizeUnit |
Unit of the file size |
Enter the unit of the file size to be output. "B", "KB", "MB", "GB", or "TB" can be specified. |
-- |
Input |
R |
common.returnValue |
Return value for the plugin |
The return value of this plugin stored. |
-- |
Output |
-- |
common.outputFileSize |
File size to be output |
Store the file or folder size to be output. |
-- |
Output |
-- |
common.outputFileSizeUnit |
Unit of the file size to be output |
Store the unit of the file size to be output. |
-- |
Output |
-- |