-
July 26th, 2004, 10:12 PM
#1
Junior Member
How to disable Windows NT/2000/XP file system cache?
As we know, all NTs use caching during file operations (read ahead/leazy write). So when I try to read from a file which have already been accessed by another application I receive the contenet of the file system cache. Is there any flag(s) i can specify in my call to CreateFile/NtCreateFile to bypass using of FS cache and receive data directly from storage?
-
July 27th, 2004, 01:21 AM
#2
Why would you wish to do that?
-
July 27th, 2004, 01:40 AM
#3
Correct me if I'm wrong, but wouldn't that actually slow down your computer when opening files???
-
July 27th, 2004, 03:42 AM
#4
Here are a couple of articles on modifying caching in a Windows enviornment. It requires registry modifications.... use at your own risk
http://www.dataaccess.com/whitepaper...adcaching.html
http://support.microsoft.com/default...;EN-US;q163401
The first link is often needed in a network database envoirnment but I think it still applies.
Hope this helps.
m2
Work... Some days it's just not worth chewing through the restraints...
-
July 27th, 2004, 03:51 AM
#5
I think what your looking for can be found at the link below. at tweakxp.com.
http://tweakxp.com/tweak905.aspx
The title "Easy Way to Adjust LargeSystemCache" is written by or based on information submitted by vanisher.
-
July 27th, 2004, 01:03 PM
#6
I dont know a way to "attach" that property on a file, but you can do this when "accessing" the file. At least on write operations, when you want to be sure the a file is written the disk (as a database log, for instance)
Meu sÃtio
FORMAT C: Yes ...Yes??? ...Nooooo!!! ^C ^C ^C ^C ^C
If I die before I sleep, I pray the Lord my soul to encrypt. If I die before I wake, I pray the Lord my soul to brake.
-
July 27th, 2004, 01:49 PM
#7
I don't think there's any way to prevent read caching, but there may be ways to prevent write-caching.
Why would you want to turn read caching off anyway?
Slarty
-
July 27th, 2004, 06:44 PM
#8
Exactly! wouldn't this overall slow down your computer?
-
July 27th, 2004, 09:09 PM
#9
Junior Member
Of course, disabling file caching will slow down the system perfomance. But i don't need to disable cache completely. I just want one of my applications to receive file data immediately from HDD, while others are working (modifying) file content in cache. Actually, I need to get the previously saved file content before any cache data was flushed to physical storage.
I don't think there's any way to prevent read caching, but there may be ways to prevent write-caching.
It seems there is a way to prevent write-caching documented in DDK (NtCreateFile's flag):
FILE_WRITE_THROUGH - System services, FSDs, and drivers that write data to the file must actually transfer the data into the file before any requested write operation is considered complete. This flag is automatically set if the CreateOptions flag FILE_NO_INTERMEDIATE
But what about read-ahead operations? Is there anything like this?
-
July 28th, 2004, 01:02 AM
#10
Zufyxe
You have come to us with a "solution" that really does not make a great deal of sense.
What we need to know are your "requirements"..............like what you want to happen, and why. Then we will tell you how.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|