Sign in to follow this  
Followers 0
Qual-IT London

Flush Disk Cache

15 posts in this topic

is there a function to flush the disk cache on a removable drive ?

so a user can just unplug it after files are written?

Share this post


Link to post
Share on other sites



Sysinternals sync?

Don't think there is a autoit function to do it, but I'm not an expert, so anyone is there?

Regards

Uten

Share this post


Link to post
Share on other sites

Sysinternals sync?

Don't think there is a autoit function to do it, but I'm not an expert, so anyone is there?

Regards

Uten

not free to distribute if you read the eula :)

Share this post


Link to post
Share on other sites

not free to distribute if you read the eula :)

At least in Windows XP each usb device has additional field "optymalization for quick removal" or "optimatization for quick access" or something like that in Device Manager for that specific device. Check it out. Unless you meant something else.


My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

not free to distribute if you read the eula :)

You might try it in c, i think this will work

// crt_flushall.c
/* This program uses _flushall
 * to flush all open buffers.
 */

#include <stdio.h>

int main( void )
{
   int numflushed;

   numflushed = _flushall();
   printf( "There were %d streams flushed\n", numflushed );
}

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

You might try it in c, i think this will work

// crt_flushall.c
/* This program uses _flushall
 * to flush all open buffers.
 */

#include <stdio.h>

int main( void )
{
   int numflushed;

   numflushed = _flushall();
   printf( "There were %d streams flushed\n", numflushed );
}
thanks!

is there an exe anywhere! i dont know how 2 compile it:)

Share this post


Link to post
Share on other sites

thanks!

is there an exe anywhere! i dont know how 2 compile it:)

Why not use what's builtin WINDOWS?!


My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

Why not use what's builtin WINDOWS?!

whats built into windows?!

i can call from autoit script?

Share this post


Link to post
Share on other sites

whats built into windows?!

i can call from autoit script?

At least in Windows XP each usb device has additional field "optymalization for quick removal" or "optimatization for quick access" or something like that in Device Manager for that specific device. Check it out. Unless you meant something else.


My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

And if you do not find a builtin solution. Grab a copy of Dev-C, Cut and past the code @gafrost provided in a new project and hit the compile button.

Edited by Uten

Share this post


Link to post
Share on other sites

And if you do not find a builtin solution. Grab a copy of Dev-C, Cut and past the code @gafrost provided in a new project and hit the compile button.

Well Mr Frost!

Thanks to the nice person who left the last comments i compiled it no probs. cheers

Its very very fast; not like the sysinternals one that takes a good 3 or 4 seconds

this one just instantly says "3 items flushed" and i dont see any disk activity.

Is this really flushing the disk cache; for all drives or just my hard drive?

Not sure what this code does

Share this post


Link to post
Share on other sites

Well Mr Frost!

Thanks to the nice person who left the last comments i compiled it no probs. cheers

Its very very fast; not like the sysinternals one that takes a good 3 or 4 seconds

this one just instantly says "3 items flushed" and i dont see any disk activity.

Is this really flushing the disk cache; for all drives or just my hard drive?

Not sure what this code does

http://msdn.microsoft.com/library/default....t__flushall.asp

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites
UnxUtils has a sync.exe that you might be able to package in your script. Check it's EULA.

My UDFs: ExitCodes

Share this post


Link to post
Share on other sites

Is this really flushing the disk cache; for all drives or just my hard drive?

Not shure how you have monitored the USB disk until now, but I supose you could monitor with Filemon from sysinternals and see if you get any activity after the flush call.

Share this post


Link to post
Share on other sites

Not shure how you have monitored the USB disk until now, but I supose you could monitor with Filemon from sysinternals and see if you get any activity after the flush call.

i havent looked at this thread since this morning!

i found and used the unxutils at lunchtime today and we've got that sync.exe working...

thank u to all of u for ur comments

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0