Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > RE: IE Temporary Internet Files & Python

Reply
Thread Tools

RE: IE Temporary Internet Files & Python

 
 
Tim Golden
Guest
Posts: n/a
 
      11-10-2005
[rtilley]

> Below is a script that recursively deletes files from a directory. It
> works well on the two directories that I'm currently using it on:


> C:\Documents and Settings\user\Cookies
> C:\Documents and Settings\user\Temp


> However, I'd like to use it on this directory as well:


> C:\Documents and Settings\user\Temporary Internet Files


> The script does not seem to work when used on Temporary Internet

Files.
> I've googled around a bit, but haven't found any tips... thought I'd
> trouble the list for an answer or at least some explanations.


> Feel free to critiqe the script as well. Perhaps it's a programmer

error.

Temporary Internet Files is one of those special shell folders
and, I suspect, isn't really a folder at all in the normal sense:
it just presents itself as one to the O/S. (Might be wrong there).
Probably means you have to use shell functions to access it.
Quick trial with SHFileOperation works up to a point, but ultimately
fails with a file-in-use error.

This article:

http://www.codeguru.com/Cpp/I-N/iepr...cle.php/c1245/

uses a very different technique. The APIs in question aren't
wrapped in pywin32. You could probably get at them via ctypes.
Don't have time to try it myself at the moment.

TJG

PS Probably doesn't matter at the mo, but for general purpose
use, those folders aren't always where your script hardwires
them to be. You might need to look at the shell functions
around SHGetPathFromIDList and SHGetSpecialFolderLocation.
Tim

__________________________________________________ ______________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
__________________________________________________ ______________________
 
Reply With Quote
 
 
 
 
rtilley
Guest
Posts: n/a
 
      11-10-2005
Tim Golden wrote:
> [rtilley]
>
>
>>Below is a script that recursively deletes files from a directory. It
>>works well on the two directories that I'm currently using it on:

>
>
>>C:\Documents and Settings\user\Cookies
>>C:\Documents and Settings\user\Temp

>
>
>>However, I'd like to use it on this directory as well:

>
>
>>C:\Documents and Settings\user\Temporary Internet Files

>
>
>>The script does not seem to work when used on Temporary Internet

>
> Files.
>
>>I've googled around a bit, but haven't found any tips... thought I'd
>>trouble the list for an answer or at least some explanations.

>
>
>>Feel free to critiqe the script as well. Perhaps it's a programmer

>
> error.
>
> Temporary Internet Files is one of those special shell folders
> and, I suspect, isn't really a folder at all in the normal sense:
> it just presents itself as one to the O/S. (Might be wrong there).
> Probably means you have to use shell functions to access it.
> Quick trial with SHFileOperation works up to a point, but ultimately
> fails with a file-in-use error.
>
> This article:
>
> http://www.codeguru.com/Cpp/I-N/iepr...cle.php/c1245/
>
> uses a very different technique. The APIs in question aren't
> wrapped in pywin32. You could probably get at them via ctypes.
> Don't have time to try it myself at the moment.
>
> TJG
>
> PS Probably doesn't matter at the mo, but for general purpose
> use, those folders aren't always where your script hardwires
> them to be. You might need to look at the shell functions
> around SHGetPathFromIDList and SHGetSpecialFolderLocation.
> Tim


Thanks a lot Tim. I hadn't been using the win32 extensions... guess I'll
have to now. How I love Windows
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: copy some files from IE temporary internet files Tim Golden Python 0 04-19-2010 12:29 PM
Internet Explorer 8: C:\Program Files\Internet Explorer\iexplore.exe vs C:\Program Files (x86)\Internet Explorer\iexplore.exe Nathan Sokalski Windows 64bit 16 02-22-2010 08:31 AM
anonymous array of strings // ("taking address of temporary"- how long is temporary valid?) anon.asdf@gmail.com C++ 7 02-12-2008 10:58 AM
Account that creates folders and files under Temporary Internet files rogersw8n@gmail.com ASP .Net 5 01-26-2007 06:54 PM
IE Temporary Internet Files & Python rtilley Python 2 11-10-2005 04:03 PM



Advertisments