[futurebasic] FILES$ is busted?

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 2002 : Group Archive : Group : All Groups

From: "Wolf, John" <JWOLF@...>
Date: Wed, 26 Jun 2002 10:19:48 -0500
There appears to be a bug in FB^3 v6 with the FILES$(<index>) statement. It
only happens when compiled as Carbon.

Try this little ditty and tell me if it acts up for you (Compile as Carbon.)
This test uses a fixed path, since my original routine is accessing files in
fixed locations on a server. For a fair test, your hard drive name will need
to be "Macintosh HD".

When compiled as Carbon all I get is the letter "C" printed out, or nothing
at all. When compiled as PPC, I get the expected reult of the first file in
the named directory.

I have since replaced the FILES$ statement with calls to PBGETCATINFO and
all is well.

There is another issue with a PPC compile of the FILES$ statement that
causes problems when VM is off under OS9. I haven't put together a clear,
concise way to replicate it yet. This issue can extend outside of your
program and cause the whole computer to go flakey when VM is off. (Finder
windows don't redraw, Apple menu items won't open, etc.)

I'm guessing the new routines to allow working directory numbers to work
under carbon still have a few bugs to iron out.


DIM PathName AS STR255
DIM Result AS STR255
DIM @ RefNum AS SHORT

PathName = "Macintosh HD:"
Result = FILES$(-1,,PathName,RefNum)
PRINT "Result: " Result

DO
UNTIL FN BUTTON