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
Post a Comment