Promotic
Login logon

FileGetAttr - method of the Pm object

Description:
Returns the file attributes.
Syntax:
Long FileGetAttr(String sFile, Long nMask)
Parameters:
sFile(String) The file whose attribute setting have to be obtained.
If a full path is not entered, then it is completed relative to the application folder.
It is recommended to use the PROMOTIC path syntax - see PROMOTIC path to files or folders.
nMask(Long) Specifies which attribute setting have to be returned. For example, 1+2 returns the attributes "archive" and "read-only" settings.
1 - Returns the attribute "archive" setting.
2 - Returns the attribute "read-only" setting.
4 - Returns the attribute "hidden" setting.
Return value:
Returns the setting of required attributes according to the mask set in the nMask parameter. If file does not exist or is not accessible, then it returns the -1 value.
Note:
The FileGetLength method can be used to get the file size.

This method is not functional in Web panels.
See also:
Example:
It gets the attributes "archive" and "read-only" setting, see the nMask=1+2 parameter. The returned value is the numeric value depending on setting the bits.
If the file has set only the attribute "archive", then in nAttr there is the 1 value.
If the file has set only the attribute "read-only", then in nAttr there is the 2 value.
If the file has set both attributes, then in nAttr there is the 3 value.
JavaScriptVBScriptSelect and copy to clipboard

var sFile = "#app:file.txt";
var nAttr = Pm.FileGetAttr(sFile, 1 + 2);
if (nAttr >= 0)
{
// If the attributes were get successfully
}
PROMOTIC 9.0.34 SCADA system documentation MICROSYS, spol. s r.o.

Send page remark Contact responsible person
Navigation:
 
- Pm
 
- Abs
- Cos
- E
- Exp
- FileGetAttr
 
 
- LN2
- PI
- Pow
- Sin
- Tan
© MICROSYS, spol. s r.o.Update cookies preferences