Users who have no access to the source tree have frequently asked for a feature allowing them to download the file they were presently displaying. Despite the fact there is no button or menu command, this is possible, even with very old LXR releases. LXR has always offered a feature whose value has been underestimated: the ability to display a file in its native format, i.e. without any decoration or higlighting.

The manual procedure below describes the steps to achieve the desired result.

If you think this tip is worth being offered as a regular feature, create a Feature request and vote for it.

Procedure

  1. Display the desired file

    Point your browser on the file and select its version. The browser address bar should show something like:

    http://localhost/lxr/source/tree_name/path/to/file http://localhost/lxr/source/tree_name/path/to/file?_v=x First line (no query arguments) is the default case when no explicit version is selected. Second line with question mark (?) and key-value pairs selects specific characteristics of the file (version, architecture, …).
  2. Modify the URL
    • Default version There is no ? in the URL

      Add ?_raw=1 at the end of the URL to obtain:

      http://localhost/lxr/source/tree_name/path/to/file?_raw=1
    • Non-default version Query arguments are already present after ? in the URL

      Add &_raw=1 at the end of the URL to obtain:

      http://localhost/lxr/source/tree_name/path/to/file?_v=x&_raw=1

    Hit "return" to redisplay the file in raw mode.

  3. Download the file

    If your browser do not support the MIME type of the file, it will open a dialog offering the possibility to download it.

    Otherwise, once the file is displayed on screen, use the browser menu command File->Save as … (or equivalent).

Notes