EldoS | Feel safer!

Software components for data protection, secure storage and transfer

OpenFile notification instead of CreateFile

Also by EldoS: SecureBlackbox
200+ components and classes for digital security, signing, encryption and secure networking.
#9979
Posted: 05/11/2009 11:16:51
by Steven Crouchman (Standard support level)
Joined: 05/05/2009
Posts: 17

I have the FileMon sample set to watch "C:\Backed up\*.*" and am using the following .Net code to create a file.

using( System.IO.FileStream fs = new System.IO.FileStream(@"C:\Backed up\Test.txt", System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.ReadWrite, System.IO.FileShare.None) )
{
fs.SetLength(1024);
fs.Flush();
fs.Close();
}

As the file does not exist I was expecting the CreateFile notification to be fired however it appears that OpenFile is fired instead. Is this an error on your behalf or is this expected behaviour?
#10003
Posted: 05/13/2009 02:16:44
by Vladimir Cherniga (EldoS Corp.)

Only file system knows if file exists or not. System.IO.FileMode.OpenOrCreate means that file may be already exists. In such case we invoke OnOpenFile callback. OnCreateFile callback is invoked only when clear Create request comes. You can read the related thread in the forum http://www.eldos.com/forum/read.php?P...av_start_2.
And this thread http://www.eldos.com/forum/read.php?F...essage6907
#10057
Posted: 05/19/2009 05:32:30
by Phil Nash (Standard support level)
Joined: 05/18/2009
Posts: 10

I have the same issue here. I posted my own findings and questions at the end of the first thread you cited there - http://www.eldos.com/forum/read.php?FID=14&TID=1674&MID=10052&phrase_id=390128#message10052

I thought I'd reference it here in case that one got lost in the noise.

Reply

Statistics

Topic viewed 2719 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!