Click here to Skip to main content
16,015,296 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Regular Dll with dialog box Pin
igor196020-Oct-03 11:38
igor196020-Oct-03 11:38 
GeneralRe: Regular Dll with dialog box Pin
ahmadnoori20-Oct-03 13:15
ahmadnoori20-Oct-03 13:15 
QuestionCreateFile and LockFile in atomic operation? Pin
Joe Woodbury20-Oct-03 10:44
professionalJoe Woodbury20-Oct-03 10:44 
AnswerRe: CreateFile and LockFile in atomic operation? Pin
John M. Drescher20-Oct-03 11:05
John M. Drescher20-Oct-03 11:05 
AnswerRe: CreateFile and LockFile in atomic operation? Pin
Neville Franks21-Oct-03 10:12
Neville Franks21-Oct-03 10:12 
GeneralRe: CreateFile and LockFile in atomic operation? Pin
Joe Woodbury21-Oct-03 10:57
professionalJoe Woodbury21-Oct-03 10:57 
GeneralRe: CreateFile and LockFile in atomic operation? Pin
Neville Franks21-Oct-03 11:08
Neville Franks21-Oct-03 11:08 
GeneralRe: CreateFile and LockFile in atomic operation? Pin
Joe Woodbury21-Oct-03 13:18
professionalJoe Woodbury21-Oct-03 13:18 
Neville Franks wrote:
Only from another process.

Exactly.

I need to create a file and lock the whole file. I then write the header and additional data and then change the lock to cover only the additional data so only the header is readable.

During the create process, the file must be locked. Once created, all but the first 16 bytes must be locked. If I create the file, then reopen it, there are synchronization problems. A Mutex solves this on a single workstation, but not if the file is being accessed from multiple clients in a shared directory. The ugly solution is to create a guard file except there is a situation where one of the clients could be opening the file in read only mode (and the target directory is read only.)

All this could be solved by allowed a create and lock in an atomic operation. (Actually, if I could have the entire creation process as a single transaction, that would be perfect. But since the shared directory may not even be Win32, this isn't viable.



Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke

GeneralGet Pin
Anonymous20-Oct-03 9:16
Anonymous20-Oct-03 9:16 
GeneralRe: Get Pin
Joe Woodbury20-Oct-03 9:42
professionalJoe Woodbury20-Oct-03 9:42 
GeneralRe: Get Pin
David Crow20-Oct-03 10:09
David Crow20-Oct-03 10:09 
GeneralAbout burning libraries... Pin
Rafael Fernández López20-Oct-03 8:23
Rafael Fernández López20-Oct-03 8:23 
GeneralRe: About burning libraries... Pin
Joe Woodbury20-Oct-03 9:45
professionalJoe Woodbury20-Oct-03 9:45 
GeneralRe: About burning libraries... Pin
Rafael Fernández López20-Oct-03 11:02
Rafael Fernández López20-Oct-03 11:02 
GeneralRe: About burning libraries... Pin
jhwurmbach20-Oct-03 22:07
jhwurmbach20-Oct-03 22:07 
GeneralRe: About burning libraries... Pin
Rickard Andersson2020-Oct-03 10:35
Rickard Andersson2020-Oct-03 10:35 
GeneralRe: About burning libraries... Pin
Rafael Fernández López20-Oct-03 10:58
Rafael Fernández López20-Oct-03 10:58 
GeneralRe: About burning libraries... Pin
Terry O'Nolley20-Oct-03 11:48
Terry O'Nolley20-Oct-03 11:48 
GeneralRe: About burning libraries... Pin
Rafael Fernández López20-Oct-03 19:23
Rafael Fernández López20-Oct-03 19:23 
GeneralRe: About burning libraries... Pin
Terry O'Nolley21-Oct-03 13:49
Terry O'Nolley21-Oct-03 13:49 
GeneralRe: About burning libraries... Pin
Anthony_Yio20-Oct-03 15:24
Anthony_Yio20-Oct-03 15:24 
GeneralRe: About burning libraries... Pin
Rafael Fernández López20-Oct-03 19:22
Rafael Fernández López20-Oct-03 19:22 
GeneralRe: About burning libraries... Pin
Anthony_Yio20-Oct-03 20:07
Anthony_Yio20-Oct-03 20:07 
GeneralRe: About burning libraries... Pin
Iain Clarke, Warrior Programmer21-Oct-03 23:37
Iain Clarke, Warrior Programmer21-Oct-03 23:37 
GeneralRe: About burning libraries... Pin
jhwurmbach20-Oct-03 22:14
jhwurmbach20-Oct-03 22:14 

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.