Re: How to get information from the download manager?
Re: How to get information from the download manager?
- Subject: Re: How to get information from the download manager?
- From: SA Dev <email@hidden>
- Date: Wed, 29 Jun 2005 09:51:48 -0400
As a followup, a few thoughts. First, this *only* gives you the
download history for Safari. If the user used another browser, it
obviously won't show up here. If this is *only* a Safari-related
task, you should be fine.
Also, for a 'live' view, you'd probably want to use Uli's UKKQueue
to monitor it (the .plist file) for changes. He just posted an update
to it a few messages ago, but if you want your app to update when a
new download is put into this plist, you'll need a way of monitoring
the file for changes (which is what UKKQueue is all about). Any time
the file changes, you'll need to reload the plist file to see the
changes.
Finally, I forgot to mention how you'd use the plist file. In this
particular circumstance (for the downloads file), you'll want to load
it as a dictionary.
NSDictionary * downloadsDict = [NSDictionary
dictionaryWithContentsOfFile:[@"~/Library/Safari/Downloads.plist"
stringByStandardizingPath]];
This code assumes the file exists. You'll want to error check to
make sure downloadsDict is not nil (if it's nil, the file failed to
load and you have no dictionary). Also, hard-coding the path probably
isn't 'best-practice', but it'll get the job done.
Finally, this was typed from memory. I'm using a company computer
today and don't have my Cocoa references handy. List, please check
the above and comment for accuracy. ;-)
On Jun 29, 2005, at 9:38 AM, SA Dev wrote:
Manish:
Are you referring to Safari's download manager? If so, you might
try looking at the file: ~/Library/Safari/Downloads.plist ... this
is the file Safari uses to track the download history.
On Jun 29, 2005, at 9:30 AM, Manish Padmajan wrote:
Hi All,
I wanted to get information about the downloaded items from the
download
manager.
Are there any specific API's (cocoa / carbon) for doing the same?
Thanks.
With rgds,
pmanish
This message is free from Virus - IMSS
<image001.gif>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40silentalcove.net
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40silentalcove.net
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden