sj1187534
Well-known member
Hi...I am having a problem with accessing the file. Heres the code that I am trying to execute.
==========================================
Dim proStat As New FileInfo("temp.tmp")
If proStat.Exists Then
Return True
Else
proStat.Create()
Return False
End If
==========================================
Later in the program, I am trying to delete this file in this way.
==========================================
Dim flinfo As New FileInfo("temp.tmp")
flinfo.Delete()
==========================================
At this point, it is giving me an error that the file is already being used by another process. i am not using this file anywhere in the program except these two. And, I guess we have no explicit way to "close" the file in the first instance since the FileInfo class has no such method.
What do you think is the problem here?
Thanks
SJ
==========================================
Dim proStat As New FileInfo("temp.tmp")
If proStat.Exists Then
Return True
Else
proStat.Create()
Return False
End If
==========================================
Later in the program, I am trying to delete this file in this way.
==========================================
Dim flinfo As New FileInfo("temp.tmp")
flinfo.Delete()
==========================================
At this point, it is giving me an error that the file is already being used by another process. i am not using this file anywhere in the program except these two. And, I guess we have no explicit way to "close" the file in the first instance since the FileInfo class has no such method.
What do you think is the problem here?
Thanks
SJ