I suppose there are quite a few ways this could happen in
code. The most obvious: you haven't actually closed the file. Say, you accidentally change the value of the variable that holds the file number (stranger things have happened), or you haven't actually closed each file number you included in your [tt]OPEN[/tt] statements.
For example....
DEFINT A-Z
' [tt]Set up a data record[/tt]
TYPE MyRecordType
MyRecord AS STRING * 255
END TYPE
DIM MyData(1) AS MyRecordType
' [tt]Open the file...[/tt]
fb = FREEFILE
OPEN "MyFile" FOR BINARY AS #fb
MyDataVariable$ = STRING$(255, "?"

' [tt]...and write some raw data to it.[/tt]
PUT #fb, 1, MyDataVariable$
' [tt]............................[/tt]
' [tt]....bunches of code here....[/tt]
' [tt]............................[/tt]
' [tt]............................[/tt]
' [tt]Then open the file for random access[/tt]
' [tt] so you can read the data into your UDT record.[/tt]
fr = FREEFILE
OPEN "MyFile" FOR RANDOM AS #fr LEN = LEN(MyData(1))
GET #fr, 1, MyData(1)
PRINT MyData(1).MyRecord
' [tt]You're finished with the file, so close it...[/tt]
CLOSE #fr
' [tt]You just want to make sure, so close it a few more times...[/tt]
CLOSE #fr
CLOSE #fr
CLOSE #fr
CLOSE #fr
' [tt]I hear somebody laughing out there.[/tt]
' [tt]I'm not being sarcastic,[/tt]
' [tt]just trying to make a point.[/tt]
' [tt]Now let's delete the file....[/tt]
KILL "MyFile"
' [tt]Hmmm... that doesn't work. The file is already open....[/tt]
' [tt]Didn't I just close it five times?[/tt]
I would suggest that you post some
code so we can take a look at it... but that would probably be pointless. You will probably discover your error and correct it, forgetting all about your question.