Hello,

I'm developing a application where the content write in disk is
criticail, then I need ensure that the wirted data are really post in disk.
I don't sure tha Flush method is sufficient. The .NET don't has a equivalent
ao Sync method in Java?


Regards...
Nulll

Re: Hard sync device in FileStream... by Hermit

Hermit
Tue Sep 28 15:49:12 CDT 2004

Flush() call on a stream should be sufficient to flush any data in the
buffer. When you are done Close() and Dispose() the stream object and you
can be pretty sure its done the job.

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"nulll" <nulll@clt.uk> wrote in message
news:OzhGL#YpEHA.536@TK2MSFTNGP11.phx.gbl...
> Hello,
>
> I'm developing a application where the content write in disk is
> criticail, then I need ensure that the wirted data are really post in
disk.
> I don't sure tha Flush method is sufficient. The .NET don't has a
equivalent
> ao Sync method in Java?
>
>
> Regards...
> Nulll
>



Re: Hard sync device in FileStream... by nulll

nulll
Tue Sep 28 16:09:15 CDT 2004

Thank's.... But, Flush send data to SO, no? Send to SO don't ensure that it
was send to disk... In other languages, such as Java, work like it.. How
.NET Framework wok about it?

I don't send to my client code a notification that data was send to disk
(when I call Flush), if has chance of the date is lost if SO or hardware
crash after flush....


Regards,
Nulll....


"Hermit Dave" <hermitd.REMOVE@CAPS.AND.DOTS.hotmail.com> wrote in message
news:uQ4qiyZpEHA.3196@tk2msftngp13.phx.gbl...
> Flush() call on a stream should be sufficient to flush any data in the
> buffer. When you are done Close() and Dispose() the stream object and you
> can be pretty sure its done the job.
>
> --
>
> Regards,
>
> Hermit Dave
> (http://hdave.blogspot.com)
> "nulll" <nulll@clt.uk> wrote in message
> news:OzhGL#YpEHA.536@TK2MSFTNGP11.phx.gbl...
> > Hello,
> >
> > I'm developing a application where the content write in disk is
> > criticail, then I need ensure that the wirted data are really post in
> disk.
> > I don't sure tha Flush method is sufficient. The .NET don't has a
> equivalent
> > ao Sync method in Java?
> >
> >
> > Regards...
> > Nulll
> >
>
>


Re: Hard sync device in FileStream... by Hermit

Hermit
Tue Sep 28 16:19:52 CDT 2004

have a look at

FileStream.Flush
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemIOFileStreamClassFlushTopic.asp

Stream.Flush
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemiostreamclassflushtopic.asp



--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"nulll" <nulll@clt.uk> wrote in message
news:uAq52#ZpEHA.3724@TK2MSFTNGP10.phx.gbl...
> Thank's.... But, Flush send data to SO, no? Send to SO don't ensure that
it
> was send to disk... In other languages, such as Java, work like it.. How
> .NET Framework wok about it?
>
> I don't send to my client code a notification that data was send to disk
> (when I call Flush), if has chance of the date is lost if SO or hardware
> crash after flush....
>
>
> Regards,
> Nulll....
>
>
> "Hermit Dave" <hermitd.REMOVE@CAPS.AND.DOTS.hotmail.com> wrote in message
> news:uQ4qiyZpEHA.3196@tk2msftngp13.phx.gbl...
> > Flush() call on a stream should be sufficient to flush any data in the
> > buffer. When you are done Close() and Dispose() the stream object and
you
> > can be pretty sure its done the job.
> >
> > --
> >
> > Regards,
> >
> > Hermit Dave
> > (http://hdave.blogspot.com)
> > "nulll" <nulll@clt.uk> wrote in message
> > news:OzhGL#YpEHA.536@TK2MSFTNGP11.phx.gbl...
> > > Hello,
> > >
> > > I'm developing a application where the content write in disk
is
> > > criticail, then I need ensure that the wirted data are really post in
> > disk.
> > > I don't sure tha Flush method is sufficient. The .NET don't has a
> > equivalent
> > > ao Sync method in Java?
> > >
> > >
> > > Regards...
> > > Nulll
> > >
> >
> >
>



Re: Hard sync device in FileStream... by Jonathan

Jonathan
Tue Sep 28 18:13:19 CDT 2004

That only says the data leaves the .Net world, it doesn't say it guarantees
the data isn't stored in Windows' File buffer.

Of course, you could disable write caching on the whole drive. But that is a
bit drastic.

--
Jonathan Allen


"Hermit Dave" <hermitd.REMOVE@CAPS.AND.DOTS.hotmail.com> wrote in message
news:eYpjrDapEHA.592@TK2MSFTNGP11.phx.gbl...
> have a look at
>
> FileStream.Flush
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemIOFileStreamClassFlushTopic.asp
>
> Stream.Flush
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemiostreamclassflushtopic.asp
>
>
>
> --
>
> Regards,
>
> Hermit Dave
> (http://hdave.blogspot.com)
> "nulll" <nulll@clt.uk> wrote in message
> news:uAq52#ZpEHA.3724@TK2MSFTNGP10.phx.gbl...
> > Thank's.... But, Flush send data to SO, no? Send to SO don't ensure that
> it
> > was send to disk... In other languages, such as Java, work like it.. How
> > .NET Framework wok about it?
> >
> > I don't send to my client code a notification that data was send to disk
> > (when I call Flush), if has chance of the date is lost if SO or hardware
> > crash after flush....
> >
> >
> > Regards,
> > Nulll....
> >
> >
> > "Hermit Dave" <hermitd.REMOVE@CAPS.AND.DOTS.hotmail.com> wrote in
message
> > news:uQ4qiyZpEHA.3196@tk2msftngp13.phx.gbl...
> > > Flush() call on a stream should be sufficient to flush any data in the
> > > buffer. When you are done Close() and Dispose() the stream object and
> you
> > > can be pretty sure its done the job.
> > >
> > > --
> > >
> > > Regards,
> > >
> > > Hermit Dave
> > > (http://hdave.blogspot.com)
> > > "nulll" <nulll@clt.uk> wrote in message
> > > news:OzhGL#YpEHA.536@TK2MSFTNGP11.phx.gbl...
> > > > Hello,
> > > >
> > > > I'm developing a application where the content write in
disk
> is
> > > > criticail, then I need ensure that the wirted data are really post
in
> > > disk.
> > > > I don't sure tha Flush method is sufficient. The .NET don't has a
> > > equivalent
> > > > ao Sync method in Java?
> > > >
> > > >
> > > > Regards...
> > > > Nulll
> > > >
> > >
> > >
> >
>
>



Re: Hard sync device in FileStream... by Christoph

Christoph
Wed Sep 29 00:48:48 CDT 2004

> That only says the data leaves the .Net world, it doesn't say it
guarantees
> the data isn't stored in Windows' File buffer.
>
> Of course, you could disable write caching on the whole drive. But that is
a
> bit drastic.

I know that e.g. Raid5 drives usually immediatley write to disk (unless
explicitly configured otherwise). I found that out wondering why those
supposedly top-notch drives whit high rpm were running with such a poor
performance. If you want to have the data on disk to satisfy ACID criteria
even in case of a sudden server crash you need to configure the OS /
hardware accordingly. Otherwise there are good chances your data will end up
in some cache.

CU Christoph



Re: Hard sync device in FileStream... by Hermit

Hermit
Wed Sep 29 01:41:12 CDT 2004

I agree with Chris. When you call flush its to the underlying device and
thats the end of .net's role. If you want to achieve something at the OS
level its always a good idea to fully configure it. You might want to browse
through good old win32 api's... you might find one that does the job of
writing the windows file buffer to the hard drive.

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Christoph Wienands" <cwienands@gmx.de> wrote in message
news:OmsbCgepEHA.3592@TK2MSFTNGP09.phx.gbl...
> > That only says the data leaves the .Net world, it doesn't say it
> guarantees
> > the data isn't stored in Windows' File buffer.
> >
> > Of course, you could disable write caching on the whole drive. But that
is
> a
> > bit drastic.
>
> I know that e.g. Raid5 drives usually immediatley write to disk (unless
> explicitly configured otherwise). I found that out wondering why those
> supposedly top-notch drives whit high rpm were running with such a poor
> performance. If you want to have the data on disk to satisfy ACID criteria
> even in case of a sudden server crash you need to configure the OS /
> hardware accordingly. Otherwise there are good chances your data will end
up
> in some cache.
>
> CU Christoph
>
>



Re: Hard sync device in FileStream... by nulll

nulll
Wed Sep 29 07:03:03 CDT 2004

>
> Of course, you could disable write caching on the whole drive. But that is
a
> bit drastic.
>

It is suficient ? The SO don't will make cache before send to disk (that
also would make cache)?


Regards...


Re: Hard sync device in FileStream... by nulll

nulll
Wed Sep 29 07:10:01 CDT 2004

> If you want to have the data on disk to satisfy ACID criteria
> even in case of a sudden server crash you need to configure the OS /
> hardware accordingly. Otherwise there are good chances your data will end
up
> in some cache.
>

Of course... But, I think (don't ensure) that Java sync method send data
directally to device, it prevent SO make cache... The .NET Flush is like it
also?

(Also in java sync don't prevent cache in device)

Regards,
Nulll.........