Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Win API / January 2008



Tip: Looking for answers? Try searching our database.

Can I force a read operation to actually read the media?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mike - 24 Jan 2008 03:04 GMT
>> I'm trying to detect data corruption on a usb hard drive.
>> My test program writes then reads the disk, but never finds
>> any corruption.  But if I unmount/unplug and replug the usb, the
>> corruption appears.
>>
>> It occurs that Windows 2k/xp may have cached the small files.
>> Since the changes didn't come thru the OS, the OS thinks the
>> data is good and just hands me what's in the cache from the previous
>> read.
>> I'm trying to do this with simple VB6 (legacy) code:
>>
>> Open filenamestring For Input As #1
>> inputstring = Input(14, #1)
>> Close #1
>>
>> to keep it simple.
>>
>> Is there a way to force the OS to flush the disk buffers/cache and give
>> me what's actually on the disk the next time I open the file?
>>
>> Or maybe force an unmount/remount the usb drive?
>>
>> Or do I need a more complicated file handler?
>>
>> Or maybe I'm barking up the wrong tree???  Better tree?
>>
>> I've googled for cache, flush, buffer and unbuffered and every
>> combination I can think of.  Nothing useful found.

 Thanks, mike
Signature

Return address is VALID!

expvb - 24 Jan 2008 07:27 GMT
Check FILE_FLAG_NO_BUFFERING flag description in CreateFile(). I never tried
it though.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.