72 |
|
fsHFSProcStub = 6, |
73 |
|
fsDrvStatus = 12, // Drive Status record |
74 |
|
fsFSD = 42, // File system descriptor |
75 |
< |
fsPB = 238, // IOParam (for mounting and renaming) |
75 |
> |
fsPB = 238, // IOParam (for mounting and renaming), also used for temporary storage |
76 |
|
fsVMI = 288, // VoumeMountInfoHeader (for mounting) |
77 |
|
fsParseRec = 296, // ParsePathRec struct |
78 |
|
fsReturn = 306, // Area for return data of 68k routines |
1253 |
|
#endif |
1254 |
|
WriteMacInt32(pb + ioFlMdDat, st.st_mtime + TIME_OFFSET); |
1255 |
|
|
1256 |
< |
Mac_memset(pb + ioFlFndrInfo, 0, SIZEOF_FInfo); |
1257 |
< |
uint32 type, creator; // pb may point to kernel space, but stack is switched |
1258 |
< |
get_finder_type(full_path, type, creator); |
1259 |
< |
WriteMacInt32(pb + ioFlFndrInfo + fdType, type); |
1260 |
< |
WriteMacInt32(pb + ioFlFndrInfo + fdCreator, creator); |
1261 |
< |
uint16 fflags; |
1262 |
< |
get_finder_flags(full_path, fflags); |
1263 |
< |
WriteMacInt16(pb + ioFlFndrInfo + fdFlags, fflags); |
1256 |
> |
get_finfo(full_path, pb + ioFlFndrInfo, hfs ? pb + ioFlXFndrInfo : 0); |
1257 |
|
|
1258 |
|
WriteMacInt16(pb + ioFlStBlk, 0); |
1259 |
|
WriteMacInt32(pb + ioFlLgLen, st.st_size); |
1265 |
|
|
1266 |
|
if (hfs) { |
1267 |
|
WriteMacInt32(pb + ioFlBkDat, 0); |
1275 |
– |
Mac_memset(pb + ioFlXFndrInfo, 0, SIZEOF_FXInfo); |
1268 |
|
WriteMacInt32(pb + ioFlParID, fs_item->parent_id); |
1269 |
|
WriteMacInt32(pb + ioFlClpSiz, 0); |
1270 |
|
} |
1289 |
|
if (S_ISDIR(st.st_mode)) |
1290 |
|
return fnfErr; |
1291 |
|
|
1292 |
< |
// Set attributes |
1293 |
< |
set_finder_type(full_path, ReadMacInt32(pb + ioFlFndrInfo + fdType), ReadMacInt32(pb + ioFlFndrInfo + fdCreator)); |
1294 |
< |
set_finder_flags(full_path, ReadMacInt16(pb + ioFlFndrInfo + fdFlags)); |
1292 |
> |
// Set Finder info |
1293 |
> |
set_finfo(full_path, pb + ioFlFndrInfo, hfs ? pb + ioFlXFndrInfo : 0); |
1294 |
> |
|
1295 |
|
//!! times |
1296 |
|
return noErr; |
1297 |
|
} |
1381 |
|
} |
1382 |
|
WriteMacInt32(pb + ioFlMdDat, mtime + TIME_OFFSET); |
1383 |
|
WriteMacInt32(pb + ioFlBkDat, 0); |
1384 |
+ |
|
1385 |
+ |
get_finfo(full_path, pb + ioFlFndrInfo, pb + ioFlXFndrInfo); |
1386 |
+ |
|
1387 |
|
if (S_ISDIR(st.st_mode)) { |
1393 |
– |
Mac_memset(pb + ioDrUsrWds, 0, SIZEOF_DInfo); |
1394 |
– |
Mac_memset(pb + ioDrFndrInfo, 0, SIZEOF_DXInfo); |
1395 |
– |
uint16 fflags; // pb may point to kernel space, but stack is switched |
1396 |
– |
get_finder_flags(full_path, fflags); |
1397 |
– |
WriteMacInt16(pb + ioDrUsrWds + frFlags, fflags); |
1388 |
|
|
1389 |
|
// Determine number of files in directory (cached) |
1390 |
|
int count; |
1409 |
|
} |
1410 |
|
WriteMacInt16(pb + ioDrNmFls, count); |
1411 |
|
} else { |
1422 |
– |
Mac_memset(pb + ioFlFndrInfo, 0, SIZEOF_FInfo); |
1423 |
– |
Mac_memset(pb + ioFlXFndrInfo, 0, SIZEOF_FXInfo); |
1424 |
– |
uint32 type, creator; // pb may point to kernel space, but stack is switched |
1425 |
– |
get_finder_type(full_path, type, creator); |
1426 |
– |
WriteMacInt32(pb + ioFlFndrInfo + fdType, type); |
1427 |
– |
WriteMacInt32(pb + ioFlFndrInfo + fdCreator, creator); |
1428 |
– |
uint16 fflags; |
1429 |
– |
get_finder_flags(full_path, fflags); |
1430 |
– |
WriteMacInt16(pb + ioFlFndrInfo + fdFlags, fflags); |
1412 |
|
WriteMacInt16(pb + ioFlStBlk, 0); |
1413 |
|
WriteMacInt32(pb + ioFlLgLen, st.st_size); |
1414 |
|
WriteMacInt32(pb + ioFlPyLen, (st.st_size | (AL_BLK_SIZE - 1)) + 1); |
1437 |
|
if (stat(full_path, &st) < 0) |
1438 |
|
return errno2oserr(); |
1439 |
|
|
1440 |
< |
// Set attributes |
1441 |
< |
if (S_ISDIR(st.st_mode)) { |
1442 |
< |
set_finder_flags(full_path, ReadMacInt16(pb + ioDrUsrWds + frFlags)); |
1462 |
< |
} else { |
1463 |
< |
set_finder_type(full_path, ReadMacInt32(pb + ioFlFndrInfo + fdType), ReadMacInt32(pb + ioFlFndrInfo + fdCreator)); |
1464 |
< |
set_finder_flags(full_path, ReadMacInt16(pb + ioFlFndrInfo + fdFlags)); |
1465 |
< |
} |
1440 |
> |
// Set Finder info |
1441 |
> |
set_finfo(full_path, pb + ioFlFndrInfo, pb + ioFlXFndrInfo); |
1442 |
> |
|
1443 |
|
//!! times |
1444 |
|
return noErr; |
1445 |
|
} |
1525 |
|
WriteMacInt32(fcb + fcbCrPs, 0); |
1526 |
|
WriteMacInt32(fcb + fcbVPtr, vcb); |
1527 |
|
WriteMacInt32(fcb + fcbClmpSize, CLUMP_SIZE); |
1528 |
< |
uint32 type, creator; // BeOS: fcb may point to kernel space, but stack is switched |
1529 |
< |
get_finder_type(full_path, type, creator); |
1530 |
< |
WriteMacInt32(fcb + fcbFType, type); |
1528 |
> |
|
1529 |
> |
get_finfo(full_path, fs_data + fsPB, 0); |
1530 |
> |
WriteMacInt32(fcb + fcbFType, ReadMacInt32(fs_data + fsPB + fdType)); |
1531 |
> |
|
1532 |
|
WriteMacInt32(fcb + fcbCatPos, fd); |
1533 |
|
WriteMacInt32(fcb + fcbDirID, fs_item->parent_id); |
1534 |
|
cstr2pstr((char *)Mac2HostAddr(fcb + fcbCName), fs_item->name); |