extract parts of file attributes: URL

Just starting out? Need help? Post your questions and find answers here.
Thade
Enthusiast
Enthusiast
Posts: 266
Joined: Sun Aug 03, 2003 12:06 am
Location: Austria

extract parts of file attributes: URL

Post by Thade »

Don't know how to explain in English ... I try:

If you create a link to a website in Windows Explorer the link is not actually stored in the File itself - whatever you write or change there, the original link stays intact, because its inside the fileattributes
In this case: URL and LinkTarget
You can change this in Settings (rightclick on the Filename, etc....)

How can this be done with PB?
In other words. The File System shown in Windows Explorer includes lots of informations: Name, Address, Birthday, Location, URL, Street, and hundreds of other info ...
For an automated Link-Collection it would be great if I could get and set some of them (especially URL) with a short PB snippet.
Any idea how?
--------------
Yes, its an Irish Wolfhound.
Height: 107 cm; Weight: 88 kg
infratec
Always Here
Always Here
Posts: 7622
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: extract parts of file attributes: URL

Post by infratec »

Hi,

simply open the file with ReadFile()
read in line by line and search for example for URL=
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
URL=http://www.purebasic.fr/english
IDList=
http://www.fmtz.com/formats/url-file-format/article

for binary link files:
http://download.microsoft.com/download/ ... INK%5D.pdf

Bernd
Thade
Enthusiast
Enthusiast
Posts: 266
Joined: Sun Aug 03, 2003 12:06 am
Location: Austria

Re: extract parts of file attributes: URL

Post by Thade »

Well, I was that far ...
Even got the same links searching google ...

[EDIT]
Deleted the first answer ... was based on changing the content with a hexeditor and saving it back ... in this case it is irrelevant what is inside the file ... the url still is the old one.

Yes - you are right. Thanks for the help. :)
When I read the file and use it as base for any link - replace the link and save it with another-name.url it works ... is not the way I wanted it ... but still it is a first option to get further with my program.

I thought for a function like GetFileData( .... ) but instead for the date it peeks for the URL inside the 4096 Bytes that are on the HD ;)
--------------
Yes, its an Irish Wolfhound.
Height: 107 cm; Weight: 88 kg
Post Reply