[Home]WikiPatches/MonoSlashedFileLinks

UseModWiki | WikiPatches | RecentChanges | Preferences

Since I've encountered file:/ links in html documents on a CD-ROM which I wanted to index and comment in my local wiki, I've changed the following in sub UrlLink? to enable the links:

    # Only do remote file:// and local file:/ links. No file:///c|/windows.
    if ($name =~ m'^file://?[^/]') { ##Patch
      return ("<a href=\"$name\">$name</a>", $punct);
    }

How do you use the file:/ or file:// link? I have tried without luck. Thanks in advance for the help. -- DavidCollantes

I actually don't know how widespread the usefulness of this patch can be. Usually when you want to access documents not sitting in the httpd section of a web server, you use file://. On windows you use file:/// for local files. But now I've encountered file:/ on a CD-ROM under Linux. And I wanted to index and comment those links. If you want to see if this change is valuable for you, you can link to local html files on your machine and copy them to your wiki. But I'd not enable this in public wikis... ;-) --DavidAndel

Hmmm, still, that does not answer my question. For example, if the files I want to link to are under /usr/local/files, what will the syntaxis be for file:/ or file://? That is what I wanted to know. Cheers -- DavidCollantes

file:/usr/local/files :-)

Well, it tries to open \\usr\local\files\file, which is invalid. I have disabled this on the config, since I do not find any use for it anyway. Thanks! -- DavidCollantes

It's actually file:///usr/local/files. The protocol prefix is file://. file:/usr/local/files is meaningless, just as http:/usr/local/files is meaningless (except in IE).

So why are the links on that said CD-ROM of the form file:/cdrom/...? They at least work, and the links copied to my wiki are turned to file:///cdrom/... by IE.

UseModWiki | WikiPatches | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited January 15, 2009 4:59 pm by MarkusLude (diff)
Search: