[Vm-dev] [commit][3411] Do the Pahro/ Squeak split for directory entry creation for the iOS platform.

commits at squeakvm.org commits at squeakvm.org
Tue Jul 21 06:18:29 UTC 2015


Revision: 3411
Author:   eliot
Date:     2015-07-20 23:18:27 -0700 (Mon, 20 Jul 2015)
Log Message:
-----------
Do the Pahro/Squeak split for directory entry creation for the iOS platform.

Modified Paths:
--------------
    branches/Cog/platforms/iOS/vm/Common/Classes/sqSqueakFileDirectoryAPI.m
    branches/Cog/platforms/iOS/vm/Common/Classes/sqSqueakFileDirectoryInterface.m

Property Changed:
----------------
    branches/Cog/platforms/Cross/vm/sqSCCSVersion.h


Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
___________________________________________________________________
Modified: checkindate
   - Sat Jul 18 19:13:50 PDT 2015
   + Mon Jul 20 23:17:35 PDT 2015

Modified: branches/Cog/platforms/iOS/vm/Common/Classes/sqSqueakFileDirectoryAPI.m
===================================================================
--- branches/Cog/platforms/iOS/vm/Common/Classes/sqSqueakFileDirectoryAPI.m	2015-07-19 02:15:20 UTC (rev 3410)
+++ branches/Cog/platforms/iOS/vm/Common/Classes/sqSqueakFileDirectoryAPI.m	2015-07-21 06:18:27 UTC (rev 3411)
@@ -133,23 +133,26 @@
 /* outputs: */  char *name, sqInt *nameLength, sqInt *creationDate, sqInt *modificationDate,
 					  sqInt *isDirectory, squeakFileOffsetType *sizeIfFile, sqInt *posixPermissions, sqInt *isSymlink)
 {
-	
+#if !defined(PharoVM)
+# define PharoVM 0
+#endif
 	/*Implementation notes
 	 if pathStringLength = 0 then we use the current working directory
 	 if pathStringLength > 0 then we resolve the pathString and alias */
 	sqInt status =
-	[gDelegateApp.squeakApplication.fileDirectoryLogic dir_EntryLookup: pathString 
-														   length: pathStringLength 
-															returnName: nameString
-													  returnNameLength: nameStringLength	
-															 name: name
-														   length: nameLength 
-													 creationDate: creationDate 
-												 modificationDate: modificationDate
-													  isDirectory: isDirectory
-													   sizeIfFile: sizeIfFile
-                                                 posixPermissions: posixPermissions
-                                                        isSymlink: isSymlink];
+	[gDelegateApp.squeakApplication.fileDirectoryLogic
+				  dir_EntryLookup: pathString 
+						   length: pathStringLength 
+							returnName: nameString
+					  returnNameLength: nameStringLength	
+							 name: name
+						   length: nameLength 
+					 creationDate: creationDate 
+				 modificationDate: modificationDate
+					  isDirectory: isDirectory
+					   sizeIfFile: sizeIfFile
+				 posixPermissions: (PharoVM ? posixPermissions : 0)
+						isSymlink: (PharoVM ? isSymlink : 0)];
 	return status;
 }
 

Modified: branches/Cog/platforms/iOS/vm/Common/Classes/sqSqueakFileDirectoryInterface.m
===================================================================
--- branches/Cog/platforms/iOS/vm/Common/Classes/sqSqueakFileDirectoryInterface.m	2015-07-19 02:15:20 UTC (rev 3410)
+++ branches/Cog/platforms/iOS/vm/Common/Classes/sqSqueakFileDirectoryInterface.m	2015-07-21 06:18:27 UTC (rev 3411)
@@ -75,8 +75,8 @@
               creationDate:(sqInt *)creationDate
           modificationDate:(sqInt *)modificationDate
                 sizeIfFile:(off_t *)sizeIfFile
-          posixPermissions:(sqInt *)posixPermissions
-                 isSymlink:(sqInt *)isSymlink {
+          posixPermissions:(sqInt *)posixPermissionsp
+                 isSymlink:(sqInt *)isSymlinkp {
     
 	//This minics the unix port where we resolve the file name, but the symbolic file lookup can fail. 
 	//The unix port says, oh file was there, but stat/lstat fails, so mmm kinda continue
@@ -84,23 +84,24 @@
 	
 	NSDictionary *fileAttributes;
     NSError *error;
-    
+    int isSymlink;
 	fileAttributes        = [fileMgr attributesOfItemAtPath: filePath error: &error];
     if (!fileAttributes) {
         return BAD_PATH;
     }
-    
-    *isSymlink        = [[fileAttributes objectForKey: NSFileType] isEqualToString: NSFileTypeSymbolicLink] ? 1 : 0;
-    if(*isSymlink) {
+   
+	isSymlink = [[fileAttributes objectForKey: NSFileType] isEqualToString: NSFileTypeSymbolicLink] ? 1 : 0;
+    if (isSymlinkp) *isSymlinkp = isSymlink;
+    if(isSymlink)
         //I need to check if symlink points to a directory
         *isDirectory  = [self linkIsDirectory:filePath fileManager:fileMgr];
-    } else {
+    else
         *isDirectory  = [[fileAttributes objectForKey: NSFileType] isEqualToString: NSFileTypeDirectory] ? 1 : 0;
-	}
     *creationDate     = convertToSqueakTime([fileAttributes objectForKey: NSFileCreationDate ]);
 	*modificationDate = convertToSqueakTime([fileAttributes objectForKey: NSFileModificationDate]);
 	*sizeIfFile       = [[fileAttributes objectForKey: NSFileSize] integerValue];
-	*posixPermissions = [[fileAttributes objectForKey: NSFilePosixPermissions] shortValue];
+	if (posixPermissionsp)
+		*posixPermissionsp = [[fileAttributes objectForKey: NSFilePosixPermissions] shortValue];
 	
 	/* POSSIBLE IPHONE BUG CHECK */
 	if (*creationDate == 0) 



More information about the Vm-dev mailing list