Richard

Your suggestion seems entirely plausible.  I tried adding the READWRITE clause 
to the select statement but FILE(DBF()) still returned .F.  UNTIL I did the 
SELECT on a much larger table (> 1GB, > 5000000 records).  Then, even without 
the READWRITE clause, FILE(DBF()) returned .T.

Thanks for your insight.

Paul

-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of Richard Kaye
Sent: 05 January 2016 17:02
To: [email protected]
Subject: RE: Odd/inconsistent behaviour of DBF()

The DBF() function expects to return something for the referenced 
workarea/alias so I will speculate that VFP probably just creates a file handle 
to represent the in-memory cursor.  As long as the cursor is small enough to 
exist in memory it doesn't need to create a physical file to go along with the 
file handle and that's why the FILE() function returns .F. When you close the 
workarea, it release the file handle.

Interestingly, if you create an index tag on your in-memory cursor you will get 
a 0 byte temp file on disk with a CDX extension that uses the stem of what 
DBF() returns.

Sounds like a good story to me but I bet Christof could explain it better... :-)

--

rk


-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of Paul Newton
Sent: Tuesday, January 05, 2016 11:35 AM
To: [email protected]
Subject: RE: Odd/inconsistent behaviour of DBF()

Richard

I used the NOFILTER clause and a physical file was NOT created ...

Paul

-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of Richard Kaye
Sent: 05 January 2016 16:28
To: [email protected]
Subject: RE: Odd/inconsistent behaviour of DBF()

IIRC correctly, anything that needs to be treated like a DBF, such as an 
in-memory cursor reference in an xBase function call, will create a temporary 
file. Using NOFILTER or READWRITE will force a file to be created as well.

The file extension does not make it a DBF. (See forms, class libraries, report 
and label layouts, etc.)
--

rk


-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of Paul Newton
Sent: Tuesday, January 05, 2016 11:17 AM
To: [email protected]
Subject: Odd/inconsistent behaviour of DBF()

Hi all

I hadn't noticed this before but ...

USE CNAME
SELECT * FROM CNAME INTO CURSOR TMPCNAME NOFILTER
? ALIAS()       -> tmpcname
? RECCOUNT()    -> 96
? DBF()                 -> C:\TEMP\0000TIQ10065.TMP
? FILE(DBF())   -> .F.
COPY TO TEMP STRUCTURE
USE TEMP IN 0
SELECT TEMP
APPEND FROM DBF('tmpcname')
? RECC()        -> 96

IOW APPEND FROM DBF('tmpcname') manages to add 96 records from a non-existent 
DBF (C:\TEMP\0000TIQ10065.TMP) I know that the cursor is in memory and does not 
have a presence on disk so why does DBF('tempcname') tell me that the name of 
the table is C:\TEMP\0000TIQ10065.TMP ?

Anybody have any thoughts on this behaviour?

Paul Newton

[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to