Click here to Skip to main content
15,893,622 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# Code Standards Pin
Vasudevan Deepak Kumar2-May-08 1:44
Vasudevan Deepak Kumar2-May-08 1:44 
AnswerRe: C# Code Standards Pin
Kevin McFarlane2-May-08 4:05
Kevin McFarlane2-May-08 4:05 
QuestionSystem.Reflection GetValue method Pin
MrColeyted1-May-08 20:49
MrColeyted1-May-08 20:49 
AnswerRe: System.Reflection GetValue method Pin
Hesham Amin2-May-08 2:27
Hesham Amin2-May-08 2:27 
QuestionHow to read files that are locked exclusively by other applications? Pin
JohnsonDesouza1-May-08 20:17
JohnsonDesouza1-May-08 20:17 
AnswerRe: How to read files that are locked exclusively by other applications? Pin
N a v a n e e t h1-May-08 20:59
N a v a n e e t h1-May-08 20:59 
AnswerRe: How to read files that are locked exclusively by other applications? Pin
Christian Graus1-May-08 21:07
protectorChristian Graus1-May-08 21:07 
AnswerRe: How to read files that are locked exclusively by other applications? Pin
Luc Pattyn1-May-08 22:21
sitebuilderLuc Pattyn1-May-08 22:21 
Hi,

yes you can read log files from ongoing processes provided they are coded appropriately.

you'll have to change the code: by default a file writer opens the file denying the world to
see the file's content for as long as it is open. IMO you have three options:

1.
have the writer close the file when done; from then on any app can read the file.

2.
have the writer perform open-for-append, append, close for every write it wants to execute.
that way readers will succeed most of the time. This is my way of implementing logging.
It is not great performance wise, but it works great.

3.
have the writer open the file with FileShare.Read i.e. have it allow others to read while
the writer has the file open. There are two caveats:
a) there is some buffering going on, so the writer should perform the right Flush() operation
to force the data out, making it available for the reader(s).
b) the file may be in an intermittent state (not fully consistent) when the reader gets data
at the same time the writer is adding to it. So readers should be tolerant.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

I dislike the black-and-white voting system on questions/answers. Dead | X|


Questionstatus strip - show some text Pin
lgatcodeproject1-May-08 20:17
lgatcodeproject1-May-08 20:17 
AnswerRe: status strip - show some text Pin
John Ad1-May-08 21:01
John Ad1-May-08 21:01 
QuestionRe: status strip - show some text Pin
lgatcodeproject1-May-08 21:32
lgatcodeproject1-May-08 21:32 
AnswerRe: status strip - show some text Pin
Thomas Stockwell2-May-08 10:39
professionalThomas Stockwell2-May-08 10:39 
QuestionDynamically add a property item to Property Grid Pin
Varad_Rajan1-May-08 20:02
Varad_Rajan1-May-08 20:02 
AnswerRe: Dynamically add a property item to Property Grid Pin
visualhint6-May-08 5:46
visualhint6-May-08 5:46 
QuestionNeed Help on Writing to New Line Pin
Thomas Toh1-May-08 17:59
Thomas Toh1-May-08 17:59 
AnswerRe: Need Help on Writing to New Line Pin
PIEBALDconsult1-May-08 19:05
mvePIEBALDconsult1-May-08 19:05 
AnswerRe: Need Help on Writing to New Line Pin
Christian Graus1-May-08 19:32
protectorChristian Graus1-May-08 19:32 
AnswerRe: Need Help on Writing to New Line Pin
Luc Pattyn1-May-08 22:26
sitebuilderLuc Pattyn1-May-08 22:26 
QuestionComboBox in Datagrid view Pin
cocoonwls1-May-08 17:18
cocoonwls1-May-08 17:18 
AnswerRe: ComboBox in Datagrid view Pin
Gopal.S1-May-08 21:12
Gopal.S1-May-08 21:12 
GeneralRe: ComboBox in Datagrid view Pin
cocoonwls1-May-08 22:45
cocoonwls1-May-08 22:45 
QuestionMember Function Pointers usage on class instances: Pin
Net Guy1-May-08 17:14
Net Guy1-May-08 17:14 
AnswerRe: Member Function Pointers usage on class instances: Pin
Christian Graus1-May-08 17:19
protectorChristian Graus1-May-08 17:19 
QuestionReflection Question Pin
MrColeyted1-May-08 16:49
MrColeyted1-May-08 16:49 
AnswerRe: Reflection Question Pin
PIEBALDconsult1-May-08 19:07
mvePIEBALDconsult1-May-08 19:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.