Chapter 4. Miscellaneous Topics

Networktransparency via KIO

KIO-Slaves

KDE supports networktransparency via KIO-slaves. KDiff3 uses this for reading input files and for scanning directories. This means that you can specify files and directories on local and remote resources via URLs.

Example:

   kdiff3 test.cpp  ftp://ftp.faraway.org/test.cpp
   kdiff3 tar:/home/hacker/archive.tar.gz/dir ./dir

The first line compares a local file with a file on an FTP-server. The second line compares a directory within an compressed archive with a local directory.

Other KIO-slaves that are interesting are:

  • Files from the WWW (http:),

  • Files from the FTP (ftp:),

  • Encrypted file transfer (fish:, sftp:),

  • Windows-resources (smb:),

  • Local files (file:),

Other things that are possible, but probably less useful are:

  • Man-pages (man:),

  • Info-pages (info:),

How To Write URLs

An URL has a different syntax compared with paths for local files and directories. Some things should be considered:

  • A path can be relative and can contain "." or "..". This is not possible for URLs which are always absolute.

  • Special characters must be written with "escaping". ("#"->"%23", space->"%20", etc.) E.g. A file with the name "/#foo#" would have the URL "file:/%23foo%23".

  • When URLs don't work as expected, try to open them in Konqueror first.

Capabilities of KIO-Slaves

Networktransparency has one drawback: Not all resources have the same capabilities.

Sometimes this is due to the file system of the server, sometimes due to the protocol. Here is a short list of restrictions:

  • Sometimes there is no support for links.

  • Or there is no way to distinguish if a link points to a file or a directory; always assuming a file. (ftp:, sftp:).

  • Can't always determine the filesize.

  • Limited support for permissions.

  • No possibility to modify permissions or modification time, so permissions or time of a copy will differ from the original. (See the option "Trust the size".) (To modify permissions or modification time is only possible for local files.)