]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/io/files/windows/windows.factor
When deleting a file, if it fails with "Access is denied" then set the file
[factor.git] / basis / io / files / windows / windows.factor
index f25a19df9b3cc079e0dc746406600340343c36c0..0b8c116c0f7289679920f6c81d00ee7519ea0d49 100755 (executable)
@@ -281,6 +281,15 @@ SYMBOLS: +read-only+ +hidden+ +system+
 +sparse-file+ +reparse-point+ +compressed+ +offline+
 +not-content-indexed+ +encrypted+ ;
 
+: read-only? ( file-info -- ? )
+    attributes>> +read-only+ swap member? ;
+    
+: set-file-attributes ( path flags -- )
+    SetFileAttributes win32-error=0/f ;
+    
+: set-file-normal-attribute ( path -- )
+    FILE_ATTRIBUTE_NORMAL set-file-attributes ;
+
 : win32-file-attribute ( n symbol attr -- )
     rot mask? [ , ] [ drop ] if ;