1 |
|
/* |
2 |
|
* extfs.cpp - MacOS file system for native file system access |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-2000 Christian Bauer |
4 |
> |
* Basilisk II (C) 1997-2001 Christian Bauer |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
49 |
|
#endif |
50 |
|
|
51 |
|
#include "cpu_emulation.h" |
52 |
– |
#include "macos_util.h" |
52 |
|
#include "emul_op.h" |
53 |
|
#include "main.h" |
54 |
|
#include "disk.h" |
107 |
|
static struct stat root_stat; |
108 |
|
|
109 |
|
// File system ID/media type |
110 |
< |
const int16 MY_FSID = 0x6261; // 'ba' |
111 |
< |
const uint32 MY_MEDIA_TYPE = FOURCC('b','a','s','i'); |
110 |
> |
const int16 MY_FSID = EMULATOR_ID_2; |
111 |
> |
const uint32 MY_MEDIA_TYPE = EMULATOR_ID_4; |
112 |
|
|
113 |
|
// CNID of root and root's parent |
114 |
|
const uint32 ROOT_ID = 2; |
1237 |
|
#endif |
1238 |
|
WriteMacInt32(pb + ioFlMdDat, st.st_mtime + TIME_OFFSET); |
1239 |
|
|
1240 |
< |
get_finfo(full_path, pb + ioFlFndrInfo, hfs ? pb + ioFlXFndrInfo : 0); |
1240 |
> |
get_finfo(full_path, pb + ioFlFndrInfo, hfs ? pb + ioFlXFndrInfo : 0, false); |
1241 |
|
|
1242 |
|
WriteMacInt16(pb + ioFlStBlk, 0); |
1243 |
|
WriteMacInt32(pb + ioFlLgLen, st.st_size); |
1274 |
|
return fnfErr; |
1275 |
|
|
1276 |
|
// Set Finder info |
1277 |
< |
set_finfo(full_path, pb + ioFlFndrInfo, hfs ? pb + ioFlXFndrInfo : 0); |
1277 |
> |
set_finfo(full_path, pb + ioFlFndrInfo, hfs ? pb + ioFlXFndrInfo : 0, false); |
1278 |
|
|
1279 |
|
//!! times |
1280 |
|
return noErr; |
1366 |
|
WriteMacInt32(pb + ioFlMdDat, mtime + TIME_OFFSET); |
1367 |
|
WriteMacInt32(pb + ioFlBkDat, 0); |
1368 |
|
|
1369 |
< |
get_finfo(full_path, pb + ioFlFndrInfo, pb + ioFlXFndrInfo); |
1369 |
> |
get_finfo(full_path, pb + ioFlFndrInfo, pb + ioFlXFndrInfo, S_ISDIR(st.st_mode)); |
1370 |
|
|
1371 |
|
if (S_ISDIR(st.st_mode)) { |
1372 |
|
|
1422 |
|
return errno2oserr(); |
1423 |
|
|
1424 |
|
// Set Finder info |
1425 |
< |
set_finfo(full_path, pb + ioFlFndrInfo, pb + ioFlXFndrInfo); |
1425 |
> |
set_finfo(full_path, pb + ioFlFndrInfo, pb + ioFlXFndrInfo, S_ISDIR(st.st_mode)); |
1426 |
|
|
1427 |
|
//!! times |
1428 |
|
return noErr; |
1510 |
|
WriteMacInt32(fcb + fcbVPtr, vcb); |
1511 |
|
WriteMacInt32(fcb + fcbClmpSize, CLUMP_SIZE); |
1512 |
|
|
1513 |
< |
get_finfo(full_path, fs_data + fsPB, 0); |
1513 |
> |
get_finfo(full_path, fs_data + fsPB, 0, false); |
1514 |
|
WriteMacInt32(fcb + fcbFType, ReadMacInt32(fs_data + fsPB + fdType)); |
1515 |
|
|
1516 |
|
WriteMacInt32(fcb + fcbCatPos, fd); |