Chapter 4. Miscellaneous Topics

Network transparency via KIO


The KIO library from Frameworks™ supports network transparency via KIO-slaves. KDiff3 uses this for reading input files and for scanning folders. This means that you can specify files and folders on local and remote resources via URLs.


   kdiff3 test.cpp
   kdiff3 tar:/home/hacker/archive.tar.gz/folder ./folder

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

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 folders. 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

Network transparency 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 folder; 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 Trust the size (unsafe) option.) (To modify permissions or modification time is only possible for local files.)