Sidecar file


Sidecar files, also known as buddy files or connected files, are computer files that store data which is not supported by the format of a source file.
There may be one or more sidecar files for each source file. There may also be "metadata databases" where one database contains metadata for several source files.
In most cases the relationship between the source file and the sidecar file is based on the file name; sidecar files have the same base name as the source file, but with a different extension. The problem with this system is that most operating systems and file managers have no knowledge of these relationships, and might allow the user to rename or move one of the files thereby breaking the relationship.

Examples

;Amiga Hunk metadata
;Extensible Metadata Platform
;Connected Web Files and Folders
;THM
;INF
;JPEG + WAV
;PDF + annotations
Pdf viewers which allow the reader to annotate documents with comments and drawings may store these in a sidecar file, such as Xournal's.xoj files.
;RunPacker
;Meta Information Encapsulation
A variation of this are copies of the source file which contain largely the same information, but in a different format or from a previous version:
;Exif
;Raw + JPEG
;TIF + TFW or JPG + JGW

Alternatives

Rather than storing data separately, it can be stored as part of the main file. This is particularly done for container files, which allow certain types of data to be stored in them. Instead of separate files on the file system, multiple files can be combined into an archive file, which keeps them together, but requires that software processes the archive file, rather than individual files. This is a generic solution, as archive files can contain arbitrary files from the file system.

Forks

A file system level solution for the same problem are forks, which allow multiple pieces of data to be associated with a single file. Sidecar files can be seen as "forks for file systems without native support for forks".
These can then be manipulated with usual file system tools: because the support is built into the operating system, these resource forks will not show up as separate files, and all applications inherit support for resource forks. However, forks cannot be copied to file systems without support for forks, or transmitted over a channel that does not support forks. For interchange forks are generally instead stored as sidecar file.
Mac OS and OS X are notable examples of operating systems with support for forks, in the HFS file system. However, this causes problems with exchanging over ISO 9660 format CD-ROM, FAT format MS-DOS disks, and over internet email, and requires the use of sidecar files to store this information. Microsoft NTFS supports Alternate Data Streams which are similar.