Q109601: FoxPro for Macintosh Allows Trailing Spaces in Filenames
Article: Q109601
Product(s): Microsoft FoxPro
Version(s): MACINTOSH:2.5b,3.0b
Operating System(s):
Keyword(s):
Last Modified: 05-FEB-2000
-------------------------------------------------------------------------------
The information in this article applies to:
- Microsoft FoxPro for Macintosh, version 2.5b
- Microsoft Visual FoxPro for Macintosh, version 3.0b
-------------------------------------------------------------------------------
SUMMARY
=======
In the Macintosh environment, FoxPro allows trailing spaces in filenames. This
behavior differs from that of FoxPro for Windows or FoxPro for MS-DOS, which
automatically trim the trailing spaces.
Trailing spaces in filenames could potentially cause problems in FoxPro for
Macintosh and other environments that allow long filenames.
Therefore, with the onset of more operating systems that allow long filenames and
spaces in filenames, good programming practice would warrant trimming all
filenames before actually creating the files.
MORE INFORMATION
================
Steps to Reproduce Behavior
---------------------------
1. Type the following commands in the Command window:
m.fileh = FCREATE("test ") && Note the trailing space
=FPUTS( m.fileh, "This is a test")
=FCLOSE( m.file )
2. Issue the ADIR() function. Note that the return string for this file contains
a trailing space (that is, "Test ").
NOTE: If this filename was stored in a 10-character database field, there would
be no way of determining exactly how many spaces were after the filename.
Additional query words: VFoxMac FoxMac
======================================================================
Keywords :
Technology : kbHWMAC kbOSMAC kbVFPsearch kbAudDeveloper kbFoxproSearch kbFoxPro250bMac kbVFP300bMac
Version : MACINTOSH:2.5b,3.0b
=============================================================================
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.
Copyright Microsoft Corporation 1986-2002.