Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Obtain Windows Handle Pin
Neville Franks3-Feb-04 10:17
Neville Franks3-Feb-04 10:17 
GeneralRe: Obtain Windows Handle Pin
basementman3-Feb-04 16:50
basementman3-Feb-04 16:50 
GeneralVC++ - WinXP vs Win2k + ODBC + Dbase files Pin
Qadddd3-Feb-04 8:17
Qadddd3-Feb-04 8:17 
GeneralRe: VC++ - WinXP vs Win2k + ODBC + Dbase files Pin
basementman3-Feb-04 16:52
basementman3-Feb-04 16:52 
GeneralRe: VC++ - WinXP vs Win2k + ODBC + Dbase files Pin
Qadddd3-Feb-04 23:17
Qadddd3-Feb-04 23:17 
General"File I/O notifications" question Pin
agrafov3-Feb-04 7:57
agrafov3-Feb-04 7:57 
GeneralRe: "File I/O notifications" question Pin
Neville Franks3-Feb-04 10:24
Neville Franks3-Feb-04 10:24 
GeneralRe: "File I/O notifications" question Pin
agrafov3-Feb-04 10:57
agrafov3-Feb-04 10:57 
Neville,
that's absolutely right - notification about creation of the file arrives earlier than file is uploaded completelly. But I thought, setting "async" property of XMLDocument to be "TRUE" should handle this scenario (from what I read from Documentation). What I could see from "practice" is it handles correctly only parsing "asyncronously", assuming file was completely written on the disk before. So, I agree with your suggestions, actually I thought about something like this, but:

1) I do not think last option is reliable because it depends of flushing of I/O buffers and will take some tricks to implement (which I think might make it very vulnerable)

2) For 1-st and 2-nd options (which for me sound very similar) I was not able to find "details"/"appropriate Win32 API" how to implement it. The uploading process is external, so I do not have an ability to check directly if file handle was closed.

Indirectly -
Neville Franks wrote:
to check if any processes have the file open and wait untill none do

- what functionality should be used to do this - attempt to CreateFile() with SHARE_EXCLUSIVE mode untill success? Is there any way to wait for file to be released by other process in some "Win32 API Wait()-function"?

Now I see only this solution:

for( int i = 0; i < MAX_OPEN_ATTEMPTS; ++i )
{
bool bOpen = OpenFile( EXCLUSIVE_MODE );
if( bOpen )
break;
Sleep( 1000 );
}


which I do not like because of some hardcoded Sleep statements and possible multiple attempts to open a file in an exclusive mode?

Thank you very much for your responce and I would appreciate if you have any other suggestions/comments.

Best regards,
Andrey
GeneralRe: &quot;File I/O notifications&quot; question Pin
Neville Franks3-Feb-04 11:16
Neville Franks3-Feb-04 11:16 
Generaltwo error Pin
Goh Hui Beng3-Feb-04 7:40
Goh Hui Beng3-Feb-04 7:40 
GeneralRe: two error Pin
Joe Woodbury3-Feb-04 7:55
professionalJoe Woodbury3-Feb-04 7:55 
GeneralRe: two error Pin
sps-itsec463-Feb-04 9:22
sps-itsec463-Feb-04 9:22 
General(edited) namepsaces: using ns::X and using namespace ns Pin
peterchen3-Feb-04 7:38
peterchen3-Feb-04 7:38 
GeneralRe: namepsaces: using ns::X and using namespace ns Pin
John M. Drescher3-Feb-04 7:43
John M. Drescher3-Feb-04 7:43 
GeneralRe: namepsaces: using ns::X and using namespace ns Pin
peterchen3-Feb-04 8:55
peterchen3-Feb-04 8:55 
GeneralRe: namepsaces: using ns::X and using namespace ns Pin
John M. Drescher3-Feb-04 8:57
John M. Drescher3-Feb-04 8:57 
GeneralRe: namepsaces: using ns::X and using namespace ns Pin
peterchen3-Feb-04 9:38
peterchen3-Feb-04 9:38 
GeneralRe: namepsaces: using ns::X and using namespace ns Pin
Michael Dunn3-Feb-04 8:50
sitebuilderMichael Dunn3-Feb-04 8:50 
GeneralRe: namepsaces: using ns::X and using namespace ns Pin
peterchen3-Feb-04 8:57
peterchen3-Feb-04 8:57 
GeneralRe: (edited) namepsaces: using ns::X and using namespace ns Pin
Joaquín M López Muñoz3-Feb-04 9:48
Joaquín M López Muñoz3-Feb-04 9:48 
GeneralRe: (edited) namepsaces: using ns::X and using namespace ns Pin
peterchen3-Feb-04 11:06
peterchen3-Feb-04 11:06 
GeneralRe: (edited) namepsaces: using ns::X and using namespace ns Pin
Joaquín M López Muñoz3-Feb-04 11:15
Joaquín M López Muñoz3-Feb-04 11:15 
Generalget date stamp on current running exe Pin
rayjoslyn3-Feb-04 7:14
rayjoslyn3-Feb-04 7:14 
GeneralRe: get date stamp on current running exe Pin
Ravi Bhavnani3-Feb-04 9:58
professionalRavi Bhavnani3-Feb-04 9:58 
GeneralRe: get date stamp on current running exe Pin
Jesse Evans5-Feb-04 12:18
Jesse Evans5-Feb-04 12:18 

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.