The Haiku/BeOS Tip Server
Tips and tricks for Haiku/BeOS users

Find out where your downloads came from

Contributed by: Scot Hacker
This tip is valid for: Both BeOS and Haiku

When you download files with NetPositive, the download URL is stored in the file’s META:url attribute. So if you want to be reminded of where you downloaded a file from, open a Terminal and type:

catattr META:url filename.zip

Alternatively, open the file with DiskProbe and use its Attributes menu to learn the URL. But be careful with DiskProbe — don’t edit anything while you’re in there! Death or nausea may ensue.


Here’s a little script contributed by Alexander Paersch to comfortably get the URL of a downloaded file (save as whatURL):


if [ -z $@ ] ; then

echo
echo Syntax of whatURL :
echo
echo whatURL  path/file
echo
echo
elif [ -z $(echo | catattr META:url $@ 2> /dev/null | awk '{ print $5; }')
 ] ; then

echo Cannot find the URL for that file.
elif [ -f $@ ] ; then

Output=$(echo | catattr META:url $@ 2> /dev/null | awk '{ print $5; }')
echo The URL is:  $Output
else
echo Couldn't find the file or maybe the path points to a folder or a symlink.
fi

If you replace the line

echo The URL is: $Output

with

NetPositive $Output &

Net+ will automatically open with that URL. Nifty for cancelled downloads…

Posted in Tracker & Deskbar


(comments are closed).