Merge jv
authorMerge Script
Wed, 30 Mar 2016 06:49:49 +0200
branchjv
changeset 19500 49f06f2390fa
parent 19496 7613c0fb5f3c (current diff)
parent 19499 ee8d773cead9 (diff)
child 19527 169a7088b668
Merge
CharacterArray.st
Win32Constants.st
Win32OperatingSystem.st
--- a/CharacterArray.st	Tue Mar 29 08:38:24 2016 +0100
+++ b/CharacterArray.st	Wed Mar 30 06:49:49 2016 +0200
@@ -896,10 +896,19 @@
     "Modified: 6.5.1996 / 10:35:26 / cg"
 !
 
+equalsIgnoreCase:aString
+    "This is an ST/V compatibility method and an alias for sameAs:."
+
+    ^ self sameAs:aString
+
+    "
+     'abc' equalsIgnoreCase: 'aBC'
+    "
+!
+
 replChar:oldChar with:newChar
-    "return a copy of the receiver, with all oldChars replaced
-     by newChar.
-     This is an ST/V compatibility method."
+    "return a copy of the receiver, with all oldChars replaced by newChar.
+     This is an ST/V compatibility method and an alias for copyReplaceAll."
 
     ^ self copyReplaceAll:oldChar with:newChar
 
@@ -936,7 +945,7 @@
 replString:subString withString:newString
     "return a copy of the receiver, with all sequences of subString replaced
      by newString (i.e. slice in the newString in place of the oldString).
-     This is an ST/V compatibility method."
+     This is an ST/V compatibility method and an alias for copyReplaceString."
 
     ^ self copyReplaceString:subString withString:newString
 
@@ -954,7 +963,7 @@
 
 subString:start to:end
     "same as copyFrom:to:
-     This is an ST/V compatibility method."
+     This is an ST/V compatibility method and an alias for copyFrom:to:."
 
     ^ self copyFrom:start to:end
 
--- a/Win32Constants.st	Tue Mar 29 08:38:24 2016 +0100
+++ b/Win32Constants.st	Wed Mar 30 06:49:49 2016 +0200
@@ -29,7 +29,13 @@
 		OFN_NODEREFERENCELINKS OFN_LONGNAMES OFN_ENABLEINCLUDENOTIFY
 		OFN_ENABLESIZING OFN_DONTADDTORECENT OFN_FORCESHOWHIDDEN
 		OFN_EX_NOPLACESBAR OFN_SHAREFALLTHROUGH OFN_SHARENOWARN
-		OFN_SHAREWARN'
+		OFN_SHAREWARN FILE_NOTIFY_CHANGE_FILE_NAME
+		FILE_NOTIFY_CHANGE_DIR_NAME FILE_NOTIFY_CHANGE_ATTRIBUTES
+		FILE_NOTIFY_CHANGE_SIZE FILE_NOTIFY_CHANGE_LAST_WRITE
+		FILE_NOTIFY_CHANGE_LAST_ACCESS FILE_NOTIFY_CHANGE_CREATION
+		FILE_NOTIFY_CHANGE_SECURITY FILE_ACTION_ADDED FILE_ACTION_REMOVED
+		FILE_ACTION_MODIFIED FILE_ACTION_RENAMED_OLD_NAME
+		FILE_ACTION_RENAMED_NEW_NAME'
 	poolDictionaries:''
 	category:'OS-Windows'
 !
@@ -102,6 +108,21 @@
     OFN_SHARENOWARN := 16r1.
     OFN_SHAREWARN := 16r0.
 
+    FILE_NOTIFY_CHANGE_FILE_NAME := 16r0001.
+    FILE_NOTIFY_CHANGE_DIR_NAME := 16r0002.
+    FILE_NOTIFY_CHANGE_ATTRIBUTES := 16r0004.
+    FILE_NOTIFY_CHANGE_SIZE := 16r0008.
+    FILE_NOTIFY_CHANGE_LAST_WRITE := 16r0010.
+    FILE_NOTIFY_CHANGE_LAST_ACCESS := 16r0020.
+    FILE_NOTIFY_CHANGE_CREATION := 16r0040.
+    FILE_NOTIFY_CHANGE_SECURITY := 16r0100.
+
+    FILE_ACTION_ADDED := 16r01.
+    FILE_ACTION_REMOVED := 16r02.
+    FILE_ACTION_MODIFIED := 16r03.
+    FILE_ACTION_RENAMED_OLD_NAME := 16r04.
+    FILE_ACTION_RENAMED_NEW_NAME := 16r05.
+
     "Modified: / 24-12-2010 / 11:17:57 / cg"
 ! !
 
--- a/Win32OperatingSystem.st	Tue Mar 29 08:38:24 2016 +0100
+++ b/Win32OperatingSystem.st	Wed Mar 30 06:49:49 2016 +0200
@@ -159,6 +159,13 @@
 	privateIn:Win32OperatingSystem
 !
 
+Win32Handle subclass:#Win32ChangeNotificationHandle
+	instanceVariableNames:''
+	classVariableNames:'Lobby'
+	poolDictionaries:''
+	privateIn:Win32OperatingSystem
+!
+
 Win32Handle subclass:#Win32IOHandle
 	instanceVariableNames:''
 	classVariableNames:'Lobby'
@@ -895,6 +902,7 @@
     "Modified: 7.1.1997 / 19:36:11 / stefan"
 ! !
 
+
 !Win32OperatingSystem class methodsFor:'OS signal constants'!
 
 sigABRT
@@ -7841,6 +7849,52 @@
     ^ Win32NetworkResourceHandle
 ! !
 
+!Win32OperatingSystem class methodsFor:'notifications'!
+
+createChangeNotificationHandleFor:aDirectoryPathName flags:changeFlags
+    |handle|
+
+    handle := Win32ChangeNotificationHandle new.
+%{
+    if (__isString(aDirectoryPathName)
+     && __isSmallInteger(changeFlags)) {
+        char *__dirName = __stringVal(aDirectoryPathName);
+        INT __flags = __intVal(changeFlags);
+        HANDLE __changeHandle;
+
+        __changeHandle = FindFirstChangeNotification(__dirName, FALSE, __flags);
+        if (__changeHandle == INVALID_HANDLE_VALUE) {
+            console_printf("failed to create handle\n");
+        } else {
+            __externalAddressVal(handle) = __changeHandle;
+            RETURN (handle);
+        }
+    }
+%}.
+    self primitiveFailed
+
+    "
+        |h|
+
+        [
+            h := OperatingSystem createChangeNotificationHandleFor:'.' 
+                flags:(FILE_NOTIFY_CHANGE_FILE_NAME  |
+                       FILE_NOTIFY_CHANGE_DIR_NAME |
+                       FILE_NOTIFY_CHANGE_ATTRIBUTES |
+                       FILE_NOTIFY_CHANGE_SIZE |
+                       FILE_NOTIFY_CHANGE_LAST_WRITE).
+            Transcript showCR:'waiting...'.
+            OperatingSystem waitForSingleObject:h withTimeout:1000.
+            Transcript showCR:'got a change...'.
+            h close.
+        ] fork.
+        Delay waitForSeconds:0.25.
+        Transcript showCR:'changing...'.
+        './bla' asFilename contents:'hello'.
+
+    "
+! !
+
 !Win32OperatingSystem class methodsFor:'os queries'!
 
 executableFileExtensions
@@ -16357,6 +16411,24 @@
     "Created: / 02-08-2006 / 16:16:38 / fm"
 ! !
 
+!Win32OperatingSystem::Win32ChangeNotificationHandle class methodsFor:'documentation'!
+
+documentation
+"
+    I represent a handle on change notifications (directory changes).
+    I can be waited upon in a WaitForHandle / WaitForMultipleObjects call.
+"
+! !
+
+!Win32OperatingSystem::Win32ChangeNotificationHandle methodsFor:'release'!
+
+close
+    "close the handle"
+
+    self closeHandle.
+    self unregisterForFinalization.
+! !
+
 !Win32OperatingSystem::Win32IOHandle class methodsFor:'documentation'!
 
 documentation