Commands & Syntax > Commands > File Mainpulation >

www.perfectkeyboard.com

 

INFO - < fileinfo >() ... [Pro]

 

File INFO
<fileinfo>("File","Information","Variable for result")
Available in: Professional edition

This command retrieves information (size, creation time, last access time, last modification time) about specified file.

 

#

Parameter name

Parameter description

1

File

(Full) path to the file (e.g., "c:\mydocuments\file.doc").

2

Information

Type of the information to be retrieved. Can be one of the following values:
"SIZE" - retrieves file size
"TIME_WRITE_ISO" - retrieves the last modification time in ISO format that can be used for arithmetic and logic operations
"TIME_ACCESS_ISO" - retrieves the last access time in ISO format that can be used for arithmetic and logic operations
"TIME_CREATE_ISO" - retrieves the creation time in ISO format that can be used for arithmetic and logic operations
"TIME_WRITE" - retrieves the last modification time
"TIME_ACCESS" - retrieves the last access time
"TIME_CREATE" - retrieves the creation time
"FILE_NAME" - retrieves the name of the file
"FILE_NAME_NO_EXTENSION" - retrieves the name of the file without extension
"FILE_EXTENSION" - retrieves the file extension
"FILE_PATH" - retrieves the file full path

3

Variable for result

Variable that receives the result.

 

Example (Macro Steps):

 

1

<#> <#> This macro retrieves information about the file you select

2

Macro execution: ONLY COMMANDS

3

Variable OPERATION "SELECT_FILE" (Variable for result = vFile, Input text/variable = , Parameter 1 = Select File, Parameter 2 = , Parameter 3 = 0)

4

IF FILE "%vFile%" Exist (0)

5

File INFO : save "Size" information of file "vFile" to variable "vFileSize"

6

File INFO : save "Last modified time" information of file "vFile" to variable "vFileTime"

7

Message SHOW "" : "File size is: %vFileSize% Last modification time is: %vFileTime%" (other parameters: x = -100, y = -100, Window title = File Info, Buttons = OK, Timeout (seconds) = , Always on top = ).

8

ENDIF

Example (Plain Text):

 

<#> This macro retrieves information about the file you select

<cmds>

<var_oper>(vFile,"",SELECT_FILE,"Select File","", "0")

<if_file>("%vFile%","EXIST","0")<#>

   <fileinfo>("vFile","SIZE","vFileSize")

   <fileinfo>("vFile","TIME_WRITE","vFileTime")

   <msg>(-100,-100,"File size is: %vFileSize%

Last modification time is: %vFileTime%","File Info",1)<#>

<endif>