For an application I want to read Google Chrome's cache files. The problem is when Chrome is running the files are opened and may be updated by its process.
So when I tried
data_1 = open("C:\Users\user\AppData\Local\Google\Chrome\User Data\Default\Cache\data_1")
it gave me
IOError: [Errno 13] Permission denied: 'C:\\Users\\user\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Cache\\data_1'
.
Since it says Permission denied( EDIT : I have 'full controll' permission on the file) I also tried it on an elevated cmd window. Same happens. It works fine when Chrome is not running. I want something like this (FileShare on .net).
I think Chrome will allow shared read access because I've seen this application doing it.
Edit:
I think I'm wrong. As lulyon said it seems Chrome locks the file. Because I tried it on vb.net like:
Dim d As New FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read)
it says:
The process cannot access the file because it is being used by another process.
Initially I thought ChromeCacheView copies the file to some other location. So I took a deeper look using process monitor. Please check this screenshot. Doesn't that mean both applications are sharing the same files?
I don't think there'll be any understanding between both as ChromeCacheView is third party application. So How is it possible then?