Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Using Linux, I have more than once seen URIs of files and applications starting with file:// and application://.

What are those URIs and how to use them?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

Quoting Wikipedia:

The file URI scheme is a URI scheme specified in RFC 1630 and RFC 1738, typically used to retrieve files from within one's own computer.

and RFC 1738:

The file URL scheme is used to designate files accessible on a particular host computer. This scheme, unlike most other URL schemes, does not designate a resource that is universally accessible over the Internet.

A file URL takes the form: file://host/path

where host is the fully qualified domain name of the system on which the path is accessible, and path is a hierarchical directory path of the form directory>/directory/.../name.

As a special case, host can be the string localhost or the empty string; this is interpreted as `the machine from which the URL is being interpreted'.

Most browsers support file:// URI, co you can open file from your disk by using them in your browser address bar.

I don't think that application:// URI is standarized - there is no info about it on Wikipedia and in RFC's on IETF site and in IANA site, so usage of this URI scheme is rather application specific and designed for application internal needs.

share|improve this answer
    
Indeed if I enter file:///home/benjamin/my_file.txt, I can access and open that file. So only web browsers can read the URI? Or can I use these URIs from the terminal too? –  Benjamin May 13 '12 at 17:35
    
PS: I know the application:// or app:// from the use of zeitgeist, see: zeitgeist-project.com/docs/0.8.2/… . –  Benjamin May 13 '12 at 17:38
    
Standardization of file:// URI was done in context of web browsing so all browsers should support it. Some other programs also should support it: there is support for file:// in KDE apps, and I think that GNOME also have support for it. In git file:// is one of ways to access repository. But as you can see it is application specific... –  pbm May 13 '12 at 17:53

Under GNU/Linux , its the "mimetypes" of "application" / "extension" , its ease to configure some about that , but for beginners can be complicated

for example , if you wanna configure the "TeamSpeak 3 Server" protocol , just for the current user you can make the follow

1 - Install the teamspeak3 client in /opt/TeamSpeak3/Client


2 - Edit the file ~/.local/share/applications/mimeapps.list


3 - Add under [Default Applications] , the follow line

    x-scheme-handler/ts3server=teamspeak.desktop

    and now save the file


4 - Create the "~/.local/share/applications/teamspeak3.desktop" file , just open a text editor , add the follow lines

    [Desktop Entry]
    Encoding=UTF-8
    Version=3
    Type=Application
    Terminal=false
    Name=TeamSpeak
    Exec=/opt/TeamSpeak3/Client/ts3client_runscript.sh %u
    Path=/opt/TeamSpeak3/Client
    Icon=/opt/TeamSpeak3/Icon/TeamSpeak3.png
    StartupNotify=false
    StartupWMClass=TeamSpeak
    X-KDE-SubstituteUID=false

5 - Update the mime database of the current user , with the command line

    $ update-mime-database $HOME/.local/share/mime

6 - Try to open a url with protocol for example , some like ->

    ts3server://8.9.36.132?port=9112

Now the web-browser , ask if you wanna open with "TeamSpeak" , if you click "Open" the tool "TeamSpeak3 Client" must be connected to that server.

a brief explaniation

The Mime Protocol , its the line

x-scheme-handler/

in the same line the

"ts3server="

its the web protocol

"ts3server://"

in the same line the

teamspeak.desktop

Determine the "Application" can open that protocol

The Desktop Entry

[Desktop Entry]

Encoding=UTF-8

Version=3

Type=Application

Terminal=false

Name=TeamSpeak

Exec=/opt/TeamSpeak3/Client/ts3client_runscript.sh %u

Path=/opt/TeamSpeak3/Client Icon=/opt/TeamSpeak3/Icon/TeamSpeak3.png

StartupNotify=false StartupWMClass=TeamSpeak X-KDE-SubstituteUID=false

Ok you see the above entry , the most important of that are

"Type" -> Should be application for this type of things

"Terminal" -> Determine if a terminal are show or not

"Name" -> The "Caption" / "Name" in the Menu of the desktop

"Exec" -> Determine the script/binary path of app

"Path" -> Determine the absolute path , with wine and dosbox cause troubles

"Icon" -> Determine the Icon of the App

Note in the Exec Line at the end exist %u without double quote with that parameter the system can grab the for stablish connection

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.