Futurebasic/Language/file spec

File Spec Records
 CAUTION (Jan. 2008) Although the FSSpec structure represents the current FB standard for specifying files and directories, it is outdated since years and should not be considered for serious new FB projects. There are at least two modern alternatives to the FSSpec structure, namely the opaque FSRef structure explicated in:

“Migrating to FSRefs & long Unicode names from FSSpecs” (Apple Technical Note TN2078, May 2003)

and the FileURL outlined in:

“The death of typeFSSpec: moving along to typeFileURL” (Apple Technical Note TN2022, June 2001) Revised: February 2002 (FB^3 Release 6)

Description
File spec records (FSSpecs) are the modern replacement for FB's time tested volume reference number/file name combinatons. You can create a file spec record as follows:

A file spec record is defined in the headers as follows:

When the FSspec is used as a parameter in, or   the information is passed to file handling calls as a single record, but you may extract information from the record as follows:

OS x vs OS 9 volRefNum
OS X does not allow the use of the older vRefNum/fileName combination. In order to insure that your programs work correctly without modification, the FB runtime creates a list of parent IDs and volume reference numbers and substitutes the list element number for the old volume reference number. Look at the difference between the calls below:

System 9 

OS X 

Your program won't require changes to move from the old to the new style calls, but will become OS X savvy without any additional coding.

Extracting Real Information From FB Indexed List Information
A utility function has been provided that extracts the true volume reference number and parent ID from FB's indexed table.

Pass the pseudo volume reference number to the routine in the  parameter. On return, the true volume reference number is placed in the  variable and the correct parent ID is place in the   variable.

FSMAKEFSSPEC -&gt; FBMakeFSSpec
A utility function provided by the runtime lets you build a file spec from individual components. This function has been designed to work with all versions of the system software. It's parameters are identical to those of the toolbox version of the call, but this particular function is smart enough to know when it id dealing with real parameters and when it has encountered the indexed element number from FB's substitute parameters.

If the  parameter is a null string, FB returns information about the parent folder.

/* Not Supported by FBtoC */