Revision: 3981
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3981&view=rev
Author:   hofman
Date:     2008-06-07 07:08:52 -0700 (Sat, 07 Jun 2008)

Log Message:
-----------
Use more primitive methods to remove all EAs, it could lead to errors if 
fragments are removed.

Modified Paths:
--------------
    SkimNotesAgent/NSFileManager_SKExtendedAttributes.m

Modified: SkimNotesAgent/NSFileManager_SKExtendedAttributes.m
===================================================================
--- SkimNotesAgent/NSFileManager_SKExtendedAttributes.m 2008-06-07 14:08:38 UTC 
(rev 3980)
+++ SkimNotesAgent/NSFileManager_SKExtendedAttributes.m 2008-06-07 14:08:52 UTC 
(rev 3981)
@@ -412,13 +412,31 @@
     if  (nil == allAttributes)
         return NO;
     
+    const char *fsPath;
+    ssize_t status;
+    int err;
+    NSString *errMsg;
+    int xopts;
+    
+    if(follow)
+        xopts = 0;
+    else
+        xopts = XATTR_NOFOLLOW;
+    
     NSEnumerator *e = [allAttributes objectEnumerator];
     NSString *attrName;
     while (attrName = [e nextObject]) {
         
+        fsPath = [self fileSystemRepresentationWithPath:path];
+        status = removexattr(fsPath, [attrName UTF8String], xopts);
+        
         // return NO as soon as any single removal fails
-        if ([self removeExtendedAttribute:attrName atPath:path 
traverseLink:follow error:error] == NO)
+        if (status == -1){
+            err = errno;
+            errMsg = xattrError(err, fsPath);
+            if(error) *error = [NSError errorWithDomain:NSPOSIXErrorDomain 
code:err userInfo:[NSDictionary dictionaryWithObjectsAndKeys:path, 
NSFilePathErrorKey, errMsg, NSLocalizedDescriptionKey, nil]];
             return NO;
+        }
     }
     return YES;
 }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to