I`m sorry about the title.
So, when i start my program i start to write everything in log.txt. The problem is when i start second instance of same program and they work at same time. Second program crash because log file is in use in this time ( by first program ) how to make able second program to also to write in that file ?
Or create new file ?
JasonWung
0
Light Poster
Recommended Answers
Jump to PostI would create a log file for both programs, im not aware of a way to write simultaneously to log files. Perhaps one of the more experienced members of the forum does?
Jump to PostFine, I would create a uniquely identified log for each instance of the program.
However have found this which might provide some insight into how to do it, look at the selected answer …
Jump to PostIf you want them to write to the same log file you will have to syncronize the two applications such that neither of them try to access the same resources simultaneosly. An easy class for cross-process syncronization is the
All 9 Replies
Mike Askew
131
Veteran Poster
Featured Poster
JasonWung
0
Light Poster
Mike Askew
131
Veteran Poster
Featured Poster
JasonWung
0
Light Poster
Mike Askew
131
Veteran Poster
Featured Poster
JasonWung
0
Light Poster
Mike Askew
131
Veteran Poster
Featured Poster
JasonWung
0
Light Poster
skatamatic
371
Practically a Posting Shark
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.