Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Has anyone run into conflicts betwe

Status
Not open for further replies.

JFChem

Programmer
Jul 30, 2001
4
US
Has anyone run into conflicts between pointers and certain file operations in Delphi 3.0? I was unable to use file procedures/functions ERASE, DELETEFILE, RENAME and RENAMEFILE after I invoked code involving manipulation of pointers. I was using a two-way linked list for sorting complex data records. The aforementioned routines worked fine when they were called within a given unit BEFORE the pointers were created in that same unit, but failed after the pointers were invoked. Even after the pointers were DISPOSEd, the routines failed to work. What is more puzzling is that standard read-write routines operated fine with the very files that were inaccessible to the above functions.

The ERASE procedure produced a runtime error 'File Access Denied.' The ERASEFILE function returned a boolean value FALSE, which meant that it failed. The file that I wanted to delete remained undeleted.

To add to the puzzle, the ERASE and RENAME routines did finally work when invoked later in the separate CLOSE procedure that terminated the program.

Comments would be appreciated.
 
Hmm what kind of pointers are you talking about exactly? And did you call to CloseFile (or CloseHandle if you're working on API level) after you finished working with files?

--- markus
 
Hi McMerfy

The pointers were standard Pascal pointers specified as to type in a TYPE statement and created with the NEW operation.
l
Indeed the files were propely cosed using CloseFile before the delete and rename operations were applied.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top