DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C++ (http://www.daniweb.com/forums/forum8.html)
-   -   keeping file from web browser cache (http://www.daniweb.com/forums/thread107904.html)

VIeditorlover Feb 6th, 2008 2:14 pm
keeping file from web browser cache
 
Hi,

I have a problem - when I close my web browser it clean up cache files.
The same if is process terminated by tool like debugger or task manager.
Only known way how to do it is break power, but...
So is there a way how to bypass filesystem or kill process at once?

Thanks for any useful advices in advance!

Narue Feb 6th, 2008 2:55 pm
Re: keeping file from web browser cache
 
Is this a C++ programming question?

VIeditorlover Feb 7th, 2008 2:59 am
Re: keeping file from web browser cache
 
Definitely yes, only C++ has the power do things like that!

vijayan121 Feb 7th, 2008 4:19 am
Re: keeping file from web browser cache
 
> is there a way how to ... kill process at once?

posix: kill( process_id, SIGKILL ) ; http://www.hmug.org/man/2/kill.php http://www.hmug.org/man/3/signal.php

windows: TerminateProcess( process_handle, exit_code ) ; http://msdn2.microsoft.com/en-us/lib...14(VS.85).aspx

Narue Feb 7th, 2008 9:59 am
Re: keeping file from web browser cache
 
>only C++ has the power do things like that!
Riiiiight. So do you just want to kill a process or do you want to clear your browser cache?

VIeditorlover Feb 7th, 2008 10:27 am
Re: keeping file from web browser cache
 
What I want is to freeze content of cache folder. Just like I would pull power cord - in this case all files keep as they are and after reboot I can copy them. TerminateProcess works perfectly but obviously there is at least one next process which always clean cache up.

vijayan121 Feb 7th, 2008 12:02 pm
Re: keeping file from web browser cache
 
> What I want is to freeze content of cache folder.
> Just like I would pull power cord - in this case all files keep as they are
> and after reboot I can copy them

wouldn't it be simpler to just take a snapshot (copy the contents to a backup) of the cache folder when you want it rather than wait till after reboot?

VIeditorlover Feb 8th, 2008 5:24 am
Re: keeping file from web browser cache
 
Yes, it would. But unfortunately, these files are "in use" so I have to either write a paralel filesystem working at sector level or find some way how to deal with NTFS locks.

vijayan121 Feb 8th, 2008 6:12 am
Re: keeping file from web browser cache
 
if you have sufficient disk space to hold snapshots, you could use the Volume Shadow Copy Service. this works similarly to file system snapshots available on unix file systems through mksnap_ffs. see http://en.wikipedia.org/wiki/Volume_Shadow_Copy and http://technet2.microsoft.com/Window....mspx?mfr=true


All times are GMT -4. The time now is 1:00 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC