sj1187534 Posted May 20, 2004 Posted May 20, 2004 Hi...I am having a problem with accessing the file. Here's 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 Quote
sj1187534 Posted May 20, 2004 Author Posted May 20, 2004 Never mind..I was able to figure out whats wrong...I just changed the way I am creating the file. ========================================== Dim proStat As New FileInfo("temp.tmp") If proStat.Exists Then Return True Else proStat.Create().Close() Return False End If ========================================== Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.