MSI Factory 2.3

File.GetAttributes

File.GetAttributes

This is the first topic This is the last topic  

File.GetAttributes

This is the first topic This is the last topic  

OverviewExamples

table File.GetAttributes (

string Filename )

Example 1

all_attributes = File.GetAttributes(_TempFolder.."\\MyFile.exe");

Stores all of the attributes of the file named "MyFile.exe" in a table called "all_attributes."

Example 2

attrib = File.GetAttributes( _TempFolder .. "\\MyTempFile.tmp" );

bReadOnly = attrib.ReadOnly;

strCreationDate = attrib.CreationDate;

Stores the attributes of the MyTempFile.tmp file located in the user's temp folder in a table named attrib, then copies the ReadOnly attribute into a boolean variable named bReadOnly, and copies the file's creation date string into a variable named strCreationDate.

Example 3

-- Get the file attributes from MyTempFile.tmp, located in the temp directory

attrib = File.GetAttributes( _TempFolder .. "\\MyTempFile.tmp" );

 

if attrib.ReadOnly then

   -- The file is read only, alert the user

   Dialog.Message("Read-Only", "The file you are trying to access is read only.", MB_OK, MB_ICONSTOP, MB_DEFBUTTON1);

end

Retrieves the attributes of the file "MyTempFile.tmp" and alerts the user if the file has it's read-only attribute set.

See also: Related Actions


Learn More: Indigo Rose Software - MSI Factory - Buy Now - Contact Us