
FB II Compiler
PG PRO
Debugging
Memory
System
Mathematics
Resources
Disk I/O
Windows
Controls
Menus
Mouse
Keyboard
Text
Fonts
Drawing
Sound
Clipboard
Printing
Communication
ASM
|
DISK I/O
Find the special system folders
Try this:
'
' Available Folder types.... Where
' -----------------
' _kSystemFolderType System
' _kDesktopFolderType DeskTop
' _kTrashFolderType Trash Can
' _kWhereToEmptyTrashFolderType ???
' _kPrintMonitorDocsFolderType Print Doc's
' _kStartupFolderType Startup
' _kAppleMenuFolderType Apple menu items
' _kControlPanelFolderType Control Panels
' _kExtensionFolderType Extensions
' _kPreferencesFolderType Preferences
' _kTemporaryFolderType Temporary
'
CLEAR LOCAL
LOCAL FN GetSysFolderVol(type&)
DIM pBlock;128
DIM pBlk&
DIM Create%
DIM Drive%,DirID&
DIM ourVref%
LONG IF type& = _kTemporaryFolderType
Create% = _KCreateFolder
XELSE
Create% = _kDontCreateFolder
END IF
LONG IF FN FINDFOLDER (_kOnSystemDisk,type&,Create%,Drive%,DirID&) = _NoErr
pBlk& = @pBlock
pBlk&.ioVRefNum% = Drive%
pBlk&.ioWDDirID& = DirID&
IF FN OPENWD (pBlk&) = _noErr THEN ourVref% = pBlk&.ioVRefNum%
END IF
END FN = ourVref%
I've only used it to get the prefs folder myself...
I'll be using it soon to get the startup folder too.
|