windows - Ways to synchronize write access to a file on a network share -


i'm writing program using c++ under windows needs synchronize write access file via local network. thinking use following approach:

//create or open using 0 sharing mode handle hfile = createfile(l"\\\\server\\share\\path\\file", generic_read | generic_write, 0, , open_always, , ,); if(hfile == invalid_handle_value && ::getlasterror() == error_sharing_violation) {     //try again later } 

can confirm it's workable solution?


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -