TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
HumptyNotSoDumpty
NA
23
0
Checking for Open Text File in Notepad, and Closing it
Jul 16 2004 11:00 AM
I wonder if anyone might be able to resolve the following issue: I have a text file, which I write to using a StreamWriter. I want to be able to append to the file, but beforehand I must ensure that the file is closed. I have tried using System.Threading.Mutex(), System.Diagnostics.Process.GetCurrentProcess(), and System.Diagnostics.Process.GetProcessesByName(). But with no success. I think my problem mainly exists with either detecting whether a file is open (i.e. file locked), or the specific file is open, as opposed to the application (Notepad) which it runs in. Any assistance would be greatly appreciated. Thanks
Reply
Answers (
2
)
Generic routines
Fun with Regular Expressions (or not...)