Message 1 of 9
detecting a file in use

Not applicable
01-29-2010
03:35 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to delete an existing file and need to detect whether it is
currently open by another program. The following is a snippet of code I
tested it with:
Public Sub TestReadOnly
Dim CheckFile As New IO.FileInfo("c:\test.txt")
MsgBox("IsReadOnly = " & CheckFile.IsReadOnly)
End Sub
I open the test.txt file in Notepad and then run the above in AutoCAD. The
Msgbox says IsReadOnly = false. I would expect it to be true.
I'm stumped.
currently open by another program. The following is a snippet of code I
tested it with:
Public Sub TestReadOnly
Dim CheckFile As New IO.FileInfo("c:\test.txt")
MsgBox("IsReadOnly = " & CheckFile.IsReadOnly)
End Sub
I open the test.txt file in Notepad and then run the above in AutoCAD. The
Msgbox says IsReadOnly = false. I would expect it to be true.
I'm stumped.