OSDN Git Service

Fix archive bit trick for PO(T) scripts
authorTim Gerundt <tim@gerundt.de>
Thu, 24 Jan 2008 23:23:27 +0000 (23:23 +0000)
committerTim Gerundt <tim@gerundt.de>
Thu, 24 Jan 2008 23:23:27 +0000 (23:23 +0000)
Src/Languages/CreateMasterPotFile.vbs
Src/Languages/UpdatePoFilesFromPotFile.vbs

index 2a7de9f..68702c3 100644 (file)
@@ -33,7 +33,7 @@ Call Main
 Sub Main
   Dim oStrings, sCodePage
   Dim StartTime, EndTime, Seconds
-  Dim bNecessary
+  Dim bNecessary, oFile
   
   StartTime = Time
   
@@ -50,6 +50,11 @@ Sub Main
     SetArchiveBit "../Merge.rc", False
     SetArchiveBit "English.pot", False
     SetArchiveBit "MergeLang.rc", False
+    For Each oFile In oFSO.GetFolder(".").Files 'For all files in the current folder...
+      If (LCase(oFSO.GetExtensionName(oFile.Name)) = "po") Then 'If a PO file...
+        oFile.Attributes = oFile.Attributes XOR 32 'Set archive bit!
+      End If
+    Next
     
     EndTime = Time
     Seconds = DateDiff("s", StartTime, EndTime)
@@ -356,7 +361,7 @@ Sub SetArchiveBit(ByVal sFilePath, ByVal bValue)
       End If
     Else 'If archive bit NOT set...
       If (bValue = True) Then
-        oFile.Attributes = oFile.Attributes AND 32
+        oFile.Attributes = oFile.Attributes XOR 32
       End If
     End If
   End If
index d837dfb..3887ae5 100644 (file)
@@ -228,7 +228,7 @@ Sub SetArchiveBit(ByVal sFilePath, ByVal bValue)
       End If
     Else 'If archive bit NOT set...
       If (bValue = True) Then
-        oFile.Attributes = oFile.Attributes AND 32
+        oFile.Attributes = oFile.Attributes XOR 32
       End If
     End If
   End If