process - synchronization processes with read & write to file c# -


i trying stop other processes reading , writing file need synchronize between process,how can it?

it helpful if give me pattern it, , show me should enter read , write section in code.

alright. easy thing thought if that's aim. can use filestream open file. like..

using (var stream = new filestream(                             @"c:\files\yourfile.txt",                              filemode.open,                              fileaccess.readwrite,                              // that's important parameter set                             // locks file other processes                             // long stream persists                             fileshare.none)) {     // give logic ... } 

messed up. didn't note questions intention, bad. if try close process reading/writing file. try find out which , kill it.


Comments

Popular posts from this blog

python - jinja2: TemplateSyntaxError: expected token ',', got 'string' -

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -

Qt4: how to send QString inside a struct via QSharedMemory -