BlazeLondon Posted March 22, 2006 Share Posted March 22, 2006 is there a function to flush the disk cache on a removable drive ? so a user can just unplug it after files are written? Link to comment Share on other sites More sharing options...
Uten Posted March 22, 2006 Share Posted March 22, 2006 Sysinternals sync? Don't think there is a autoit function to do it, but I'm not an expert, so anyone is there?RegardsUten Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
BlazeLondon Posted March 22, 2006 Author Share Posted March 22, 2006 Sysinternals sync? Don't think there is a autoit function to do it, but I'm not an expert, so anyone is there?RegardsUtennot free to distribute if you read the eula Link to comment Share on other sites More sharing options...
MadBoy Posted March 22, 2006 Share Posted March 22, 2006 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) Link to comment Share on other sites More sharing options...
GaryFrost Posted March 22, 2006 Share Posted March 22, 2006 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.  Link to comment Share on other sites More sharing options...
BlazeLondon Posted March 22, 2006 Author Share Posted March 22, 2006 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:) Link to comment Share on other sites More sharing options...
MadBoy Posted March 22, 2006 Share Posted March 22, 2006 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) Link to comment Share on other sites More sharing options...
BlazeLondon Posted March 22, 2006 Author Share Posted March 22, 2006 Why not use what's builtin WINDOWS?!whats built into windows?!i can call from autoit script? Link to comment Share on other sites More sharing options...
MadBoy Posted March 22, 2006 Share Posted March 22, 2006 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) Link to comment Share on other sites More sharing options...
Uten Posted March 22, 2006 Share Posted March 22, 2006 (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 March 22, 2006 by Uten Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
BlazeLondon Posted March 22, 2006 Author Share Posted March 22, 2006 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. cheersIts very very fast; not like the sysinternals one that takes a good 3 or 4 secondsthis 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 Link to comment Share on other sites More sharing options...
GaryFrost Posted March 22, 2006 Share Posted March 22, 2006 Well Mr Frost!Thanks to the nice person who left the last comments i compiled it no probs. cheersIts very very fast; not like the sysinternals one that takes a good 3 or 4 secondsthis 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 doeshttp://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.  Link to comment Share on other sites More sharing options...
Gigglestick Posted March 22, 2006 Share Posted March 22, 2006 UnxUtils has a sync.exe that you might be able to package in your script. Check it's EULA. My UDFs: ExitCodes Link to comment Share on other sites More sharing options...
Uten Posted March 22, 2006 Share Posted March 22, 2006 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. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
BlazeLondon Posted March 22, 2006 Author Share Posted March 22, 2006 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now