Filesystem-Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Filesystem-Commands >

Filesystem-Commands

GFI. - Get File Information

Previous Top Next


MiniRobotLanguage (MRL)

 

GFI. Command

Get File Information

 

 

Intention

 

Returns version and other information from a file. Depending on parameters this can be the:

1.  CompanyName

2.  FileDescription

3.  FileVersion

4.  InternalName

5.  LegalCopyright

6.  OriginalFilename

7.  ProductName

8.  ProductVersion

or any other specified Information which is accessible in the Version Tab of the File-Properties..

 

Using the script below, we will get something like this on the Stack:

 

graphic

 

which is another representation of what you get to see if you look in the Properties dialog for the file version (see picture below).

 

graphic

 

And here is the example script that produces this output:

 

GFI.?desktop\IC_Stromwandler.exe

STS.DUMP

MBX.Ready

ENR.

 

GFI. has several modes of operation. Let us see them in more detail. If we just write:

 

GFI.

 

then the command will try to get the needed filename from the Stack. Filename is taken from TOS. Result is been put on TOS. Result contains all above listed file-Infos in one Element. Here is an example script:

 

VAR.$$FIL=?desktop\IC_Stromwandler.exe

PUV.$$FIL

GFI.

STS.DUMP

MBX.Ready

ENR.

 

Secondly, you can provide the filename in a variable.

 

VAR.$$FIL=?desktop\IC_Stromwandler.exe

GFI.$$FIL

 

The result is just the same as above. Result is been put on TOS. Result contains all above listed file-Information.

 

Now, if this is too much unneeded Information for you, you can be more selective what Information you want to have returned. Use a second parameter with the Info about what you want.

 

VAR.$$FIL=?desktop\IC_Stromwandler.exe

VAR.$$PAR=ProductVersion

GFI.$$FIL|$$PAR|$$RES

PRT.Version: $$RES

 

The possible values for $$PAR are:

 

1.   CompanyName

2.   FileDescription

3.   FileVersion

4.   InternalName

5.   LegalCopyright

6.   OriginalFilename

7.   ProductName

8.    ProductVersion

 

and finally you can provide a country-code as P4, to get exactly the information you are looking for.

 

 

 

Syntax

 

GFI.[P1][|P2[|P3][|P4]

 

 

Parameter Explanation

 

P1 - Filename

P2 - Which Information to get

P3 - Variable or "-" to return the information,

    if omitted TOS is used.

P4 - Country-code/Key-code to use.

 

GFI.P1

P1 - Filename

 

GFI.P1|P2

P1 - Filename P2 - Which Information to get

Result is been put on TOS. Result contains all above listed file-Infos.

 

GFI.P1|P2|P3

 

P1 - Filename

P2 - Which Information to get

P3 - Variable or "-" to return the information

 

GFI.[P1][|P2][|P3][|P4]

 

P1 - Filename

P2 - Which Information to get

P3 - Variable or "-" to return the information (alternatively TOS is used)

P4 - Country-code/Key-code to use.

 

Country-Keycode can be a combination like:

 040904B0  

or can be omitted, in that case the code is automatically choosen.

Alternatively a "*" can be specified in that case:

 040904E4

is used.

 

 

 

Example

 

'**********************************************

' GFI. - Sample

'**********************************************

'DBM.2

' Use Path to a existiing files

VAR.§§FIA=?path\PR01.Exe

VAR.§§FIB=?path\u9.exe

PRT.===========================================

' Get the Company-name on TOS

GFI.§§FIA|CompanyName

 

' Get Infos on TOS, separated with *

GFI.§§FIB

 

: §§VER=ProductVersion

GFI.§§FIB|§§VER|§§RES

PRT.Version: §§RES

 

: §§VER=ProductVersion

GFI.§§FIB|§§VER|§§RES

PRT.Version: §§RES

 

GFL.§§FIB|§§CKC|b

PRT.Country-Keyboard-Code: §§CKC

 

' uses §§CKC as StringFileInfo

GFI.§§FIA|CompanyName|§§RES|§§CKC

PRT.CompanyName: §§RES

 

' Uses 040904E4 as StringFileInfo

GFI.§§FIA|CompanyName|§§RES|*

PRT.CompanyName: §§RES

 

PRT.===========================================

DMP.4

END.

 

 

 

 

Remarks

 

-

 

 

Limitations:

-

 

 

 

See also:

 

    1.5.2 Working with Text-Strings

    GFD. - Get File Date

    GFV. - Get File Version

    IFD. / NFD. - If File Date

    IFV. / NFV. If File Version

    GSS. - GetSplitString

    IEF. / NEF. - If - exist - File