RE: IE Temporary Internet Files & Python

Discussion in 'Python' started by Tim Golden, Nov 10, 2005.

  1. Tim Golden

    Tim Golden Guest

    [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/ieprogram/article.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
    ________________________________________________________________________
    Tim Golden, Nov 10, 2005
    #1
    1. Advertising

  2. Tim Golden

    rtilley Guest

    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/ieprogram/article.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 ;)
    rtilley, Nov 10, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Norton
    Replies:
    6
    Views:
    1,878
    Norton
    Jun 10, 2004
  2. =?Utf-8?B?RG9uYWxk?=

    WebForms cached in Temporary Internet Files?

    =?Utf-8?B?RG9uYWxk?=, Sep 30, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    485
    =?Utf-8?B?c3Jpbmk=?=
    Oct 1, 2004
  3. rtilley
    Replies:
    2
    Views:
    397
    rtilley
    Nov 10, 2005
  4. Replies:
    5
    Views:
    750
    Juan T. Llibre
    Jan 26, 2007
  5. Tim Golden
    Replies:
    0
    Views:
    678
    Tim Golden
    Apr 19, 2010
Loading...

Share This Page