UpdateRulesMask
The UpdateRulesMask parameter is used to determine whether a file will be downloaded or uploaded. It does this by comparing the file on the local file system with the file of the same name in the Blob service. You use this parameter to tell the function how you want the files compared.
The UpdateRulesMask parameter applies to the following functions: DownloadBlobFile, DownloadBlobFileToDirectory, DownloadFromBlobPath, DownloadFromBlobPathToDirectory, UploadFileToBlob, and UploadFileToBlobPath.
Bit Values
The following table shows the bit values for creating a mask.
| Comparate | Bit Value | Action |
|---|---|---|
|
No comparison |
&h00 |
Do not compare the files, always download or upload the file. |
|
File version |
&h01 |
Compare the files' version, if they are different download or upload the file. |
|
File timestamp |
&h02 |
Compare the files' timestamp (for the file on disk, this is the Modified Time), download the file if the time of the file in Blob is newer, or upload the file if the time of the file on disk is newer. |
|
File size |
&h04 |
Compare the files' size, if they are different download or upload the file. |
|
File time different |
&h08 |
Compare the files' timestamp (for the file on disk, this is the Modified Time), if they are different download or upload the file. |
|
File does not exist |
&h10 |
Download the file only if it does not exist on disk, or upload the file only if it does not exist in the Blob service. |
You can combine any of these bits into a single mask using OR to compare by more than one method. If only one of the methods shows the file is different, it will be downloaded or uploaded.
Examples
The following example compares the file version or file size for MeterTest.csf and downloads the file if differences are found.
Dim objFileSystem
Set objFileSystem = CreateObject("CxScript.FileSystemObject")
Dim bRet
Dim updateRulesMask
'This is equivalent to a hex value of &h5 or an integer value of 5
updateRulesMask = &h01 Or &h04
bRet = objFileSystem.DownloadBlobFile("CYGDEMO.BSS", "TEST", "MeterTest.csf, updateRulesMask)
The following example compares the file version or file size or file time for MeterTest.csf and downloads the file if differences are found.
Dim objFileSystem
Set objFileSystem = CreateObject("CxScript.FileSystemObject")
Dim bRet
Dim updateRulesMask
'This is equivalent to a hex value of &0D or an integer value of 13
updateRulesMask = &h01 Or &h04 Or &h08
bRet = objFileSystem.DownloadBlobFile("CYGDEMO.BSS", "TEST", "MeterTest.csf, updateRulesMask)
The following example downloads the file MeterTest.csf if it does not exist or if the file time is different.
Dim objFileSystem
Set objFileSystem = CreateObject("CxScript.FileSystemObject")
Dim bRet
Dim updateRulesMask
'This is equivalent to a hex value of &h18 or an integer value of 24
updateRulesMask = &h10 Or &h08
bRet = objFileSystem.DownloadBlobFile("CYGDEMO.BSS", "TEST", "MeterTest.csf, updateRulesMask)


