If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Can I flush the disk cache?
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 has 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 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 -- Return address is VALID! |
#2
|
|||
|
|||
Can I flush the disk cache?
mike wrote:
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 has 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 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 does disabling write cache under device properties for the disk under windows help at all? There may also be options (this could be for XP only though) to optimize removable media for "speed" or for "fast removal". Try the fast removal option if it's there. |
#3
|
|||
|
|||
Can I flush the disk cache?
Cydrome Leader wrote:
mike wrote: 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 has 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 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 does disabling write cache under device properties for the disk under windows help at all? There may also be options (this could be for XP only though) to optimize removable media for "speed" or for "fast removal". Try the fast removal option if it's there. That's the default setting. Write caching should be for writes. My problem is with reads. -- Return address is VALID! |
#4
|
|||
|
|||
Can I flush the disk cache?
Or maybe unmount/remount the usb drive?
Yes. You need not flush but purge, and cache purges in Windows is only done by remount. -- Maxim Shatskih, Windows DDK MVP StorageCraft Corporation http://www.storagecraft.com |
#5
|
|||
|
|||
Can I flush the disk cache?
does disabling write cache under device properties for the disk under
windows help at all? This will not disable the cache completely, especially for reads. -- Maxim Shatskih, Windows DDK MVP StorageCraft Corporation http://www.storagecraft.com |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
cartridge flush liquid | Roy | Printers | 2 | September 15th 05 11:43 AM |
Does mountvol flush the buffer cache? | Joerg Lenneis | Storage & Hardrives | 3 | November 29th 04 10:24 PM |
Disabling disk cache? | Nuno Magalhaes | Storage & Hardrives | 8 | October 30th 03 10:31 PM |
Disabling disk cache? | Nuno Magalhaes | Storage (alternative) | 3 | October 27th 03 04:21 AM |
Disabling disk cache? | Nuno Magalhaes | General | 2 | October 27th 03 12:08 AM |