![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
![]() |
| |
| | #1 (permalink) |
| | When using System.IO.FileStream, I write 8 bytes, then seek to the start of the file, does the 8 bytes get flushed on seek and the buffer become a readbuffer at that point instead of being a write buffer? When using System.IO.FileStream, I write 8 bytes, then seek to the start of the file, does the 8 bytes get flushed on seek and the buffer become a readbuffer at that point instead of being a write buffer? |
My System Specs![]() |
| | #2 (permalink) |
| | Re: When using System.IO.FileStream, I write 8 bytes, then seek to the start of the file, does the 8 bytes get flushed on seek and the buffer become a readbuffer at that point instead of being a write buffer? "DR" <softwareengineer98037@xxxxxx> wrote in message news:OZoyDzR8IHA.1200@xxxxxx Quote: > When using System.IO.FileStream, I write 8 bytes, then seek to the start Quote: > the file, does the 8 bytes get flushed on seek and the buffer become a > readbuffer at that point instead of being a write buffer? > > flush on the seek. However whether you should rely in that behaviour depends on why you asked the question. If you are worried that you might be overwritting data that hasn't been stored yet then don't be. If you want to make sure that data is persisted before doing other things then you should explicitly flush. Just because seek appears to flush in a the above case may simply be a result of specific OS decisions. In other circumstances the underlying OS (on windows FileStream is a fairly transparent wrapper on the Win APIs for these operations) may make other choices. -- Anthony Jones - MVP ASP/ASP.NET |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| how to get powershell to write to event log or write a log file? | PowerShell | |||
| Hide N' Go Seek HDD | Vista hardware & devices | |||
| Please advise where to seek help? | Vista General | |||
| Slow File transfer - 0 bytes/sec | General Discussion | |||
| Windows Explorer: Display File Size Column In Bytes? | Vista file management | |||