sFile | (String) The file whose attributes have to be changed.
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 attributes have to be set. For example, 1+2 enables setting the attributes "archive" and "read only". These attributes are set or reset according to setting the corresponding bits in the nValue parameter.
1 - The "archive" attribute is set/reset in the file.
2 - The "read only" attribute is set/reset in the file.
4 - The "hidden" attribute is set/reset in the file. |
nValue | (Long) The value of attributes for setting. It is possible to enter a combination of bits, for example 1+2, i.e. the file has set the attributes "archive" and "read only". Setting the corresponding bits has to be enabled in the nMask parameter.
1 - If the value is set and the corresponding bit in the nMask parameter is enabled, then the "archive" attribute is set in the file.
2 - If the value is set and the corresponding bit in the nMask parameter is enabled, then the "read only" attribute is set in the file.
4 - If the value is set and the corresponding bit in the nMask parameter is enabled, then the "hidden" attribute is set in the file. |
var sFile = "#app:file.txt";
var retval = Pm.FileSetAttr(sFile, 2, 2);
if (retval)
{
// If the attribute was set OK
}
var sFile = "#app:file.txt";
var retval = Pm.FileSetAttr(sFile, 2, 0);
if (retval)
{
// If the attribute setting was reset OK
}
var sFile = "#app:file.txt";
var retval = Pm.FileSetAttr(sFile, 1 + 2, 1);
if (retval)
{
// If the attributes were set OK
}