Path Rules for FoxPro for MacintoshLast reviewed: June 1, 1996Article ID: Q127776 |
The information in this article applies to:
SUMMARYThe following information describes differences and similarities in path constructs between the Macintosh and MS-DOS platforms and explains how to use path constructs in FoxPro.
MORE INFORMATIONThe rules for naming drives differ on the Macintosh and MS-DOS platforms. The drive name on the MS-DOS platform consists of a single character followed by a colon such as C: or D:. On the Macintosh, a drive name may look like "Mac HD:" or "Barney:" (without the quotation marks). The Macintosh drive name can even contain a space between multiple letters whereas the MS-DOS style is limited to one character. Both, however, end with a colon. NOTE: Volume names, paths, and file names are not case sensitive. The term "volume" is interchangable with "drive" on the Macintosh platform.
File NamesValid characters in file names are:
A-Z, underscore, and 0-9 but do not begin a file name with a numeral.Invalid characters according to the Finder are:
Colon (:) - ASCII value 58 Some systems substitute a dash -Invalid characters according to FoxPro's Fcreate command are:
Double Quotation mark (") - ASCII value 34 Colon (:) - ASCII value 58 Backslash (\) - ASCII value 92Valid but potentially problematic characters are:
Single Quotation mark (') - ASCII value 39 Period (.) other than the one automatically appended - ASCII value 46 Space ( ) - ASCII value 32 Path StringsA path is a series of directory names or folders separated by a delimiter character such as a colon (:), which is the Macintosh notation, or a backslash (\), which is the the MS-DOS notation. The path may or may not have a file name at the end or a drive name at the beginning. NOTE: Most FoxPro for Macintosh commands accept the path in either MS-DOS backslash (\) format or Macintosh colon (:) format regardless of environment settings. However, commands and functions such as FxNewFolder() from Foxtools, which interact directly with the System, require a path in Macintosh shorthand notation. Please see SYS(2027) in FoxPro Help for more information.
When to Use Quotation MarksSurround the path and file name with quotation marks when any element of the volume, path, or file name contains any spaces or characters other than those suggested above. Surrounding a path with quotation marks may or may not be necessary, but if they are extraneous, they will be ignored.
Path ExamplesFor the following examples, assume the following structure:
Barney <-- A volume with same name as folder +-Fred1.dbf | +-Folder +-Fred2.dbf | +-SubFolder1 | +-Fred3.dbf | | | +-Barney <-- A folder with same name as volume | +-Fred5.dbf | +-SubFolder2 +-Fred4.dbfFully qualified paths to open the file FRED5.DBF:
USE Barney:Folder:SubFolder1:Barney:Fred5 USE Barney:\Folder\SubFolder1\Barney\Fred5 * incorrect USE Barney\Folder\SubFolder1\Barney\Fred5From root of the default volume to FRED3.DBF:
USE \Folder\SubFolder1\Fred3 USE \:Folder:SubFolder1:Fred3NOTE: The critical difference between a relative path and a fully qualified path to FRED5.DBF is the colon after but not before the volume name.
More Information on Relative Path RulesGiven that the default folder is SubFolder1 specified by this command:
Default=Barney:Folder:SubFolder1Two valid commands for opening the table in FoxPro are:
USE Fred3 This assumes MS-DOS shorthand that does not require a preceding path separator for references relative to the current directory. USE :Fred3 This Macintosh shorthand does require a preceding path separator for references relative to the current directory.Valid references to the child folder of current folder to FRED5.DBF are:
USE :Barney:Fred5 USE Barney\Fred5Valid references to the parent folder and FRED2.DBF are:
USE ..\Fred2 USE ::Fred2Valid references to the grandparent folder and FRED1.DBF are:
USE ..\..\Fred1 USE :::Fred1Valid references to the sibling folder and FRED4.DBF are:
USE ..\SubFolder2\Fred4 USE ::SubFolder2:Fred4 |
Additional reference words: VFoxMac 3.00b FoxMac 2.50b 2.50c 2.60a
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |