|
From: John M M. <jo...@us...> - 2003-06-20 01:43:48
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/plugins/FilePlugin
In directory sc8-pr-cvs1:/tmp/cvs-serv1832/squeak/platforms/Mac OS/plugins/FilePlugin
Modified Files:
sqMacDirectory.c
Log Message:
3.5.1b4 If we ask if a directory exists and the path given is a file, this is an error. Also for the os-8/9 vm return the internal system file error in vmparm 1202 when an openfile fails
Index: sqMacDirectory.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/plugins/FilePlugin/sqMacDirectory.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** sqMacDirectory.c 8 Feb 2003 18:26:23 -0000 1.7
--- sqMacDirectory.c 20 Jun 2003 01:43:45 -0000 1.8
***************
*** 24,27 ****
--- 24,28 ----
3.2.2B1 Jan 18th,2002 JMM check macroman, fix issues with squeak file offset
3.2.8b1 July 24th, 2002 JMM support for os-x plugin under IE 5.x
+ 3.5.1b1 May 20th, 2003 JMM isDirectory ? ENTRY_FOUND versus always found because path could be a file.
*/
***************
*** 246,250 ****
*sizeIfFile = 0;
okay = fetchFileInfo(index,&spec,(unsigned char *) name,true,&parentDirectory,isDirectory,creationDate,modificationDate,sizeIfFile,&longFileName);
! if (okay) {
CopyPascalStringToC((ConstStr255Param) longFileName,name);
*nameLength = strlen(name);
--- 247,251 ----
*sizeIfFile = 0;
okay = fetchFileInfo(index,&spec,(unsigned char *) name,true,&parentDirectory,isDirectory,creationDate,modificationDate,sizeIfFile,&longFileName);
! if (okay == noErr) {
CopyPascalStringToC((ConstStr255Param) longFileName,name);
*nameLength = strlen(name);
***************
*** 253,257 ****
return ENTRY_FOUND;
} else
! return NO_MORE_ENTRIES;
}
}
--- 254,258 ----
return ENTRY_FOUND;
} else
! return okay == fnfErr ? NO_MORE_ENTRIES : BAD_PATH;
}
}
***************
*** 441,444 ****
--- 442,446 ----
OSErr __path2fss(const char * pathName, FSSpecPtr spec);
+ extern OSErr gSqueakFileLastError;
int __open_file(const char * name, __file_modes mode, __file_handle * handle)
{
***************
*** 447,452 ****
HParamBlockRec pb;
-
ioResult = __path2fss(name, &spec);
if (__system7present()) /* mm 980424 */
{ /* mm 980424 */
--- 449,457 ----
HParamBlockRec pb;
ioResult = __path2fss(name, &spec);
+
+ if (ioResult)
+ gSqueakFileLastError = ioResult;
+
if (__system7present()) /* mm 980424 */
{ /* mm 980424 */
***************
*** 499,502 ****
--- 504,509 ----
ioResult = FSCreateFileUnicode(&parentFSRef,tokenLength,buffer,kFSCatInfoNone,NULL,NULL,&spec);
if (ioResult)
+ gSqueakFileLastError = ioResult;
+ if (ioResult)
return(__io_error);
***************
*** 529,534 ****
--- 536,545 ----
if (!(ioResult = PBHCreateSync(&pb)))
{
+ if (ioResult)
+ gSqueakFileLastError = ioResult;
set_file_type(&spec, mode.binary_io);
ioResult = PBHOpenDFSync(&pb); /* HH 10/25/97 was PBHOpenSync */
+ if (ioResult)
+ gSqueakFileLastError = ioResult;
}
}
***************
*** 543,547 ****
--- 554,565 ----
if (ioResult)
+ gSqueakFileLastError = ioResult;
+
+ if (ioResult)
PBCloseSync((ParmBlkPtr) &pb);
+ } else {
+ if (ioResult)
+ gSqueakFileLastError = ioResult;
+
}
}
|