A stub file is a computer file that appears to the user to be on disk and immediately available for use, but is actually held either in part or entirely on a different storage medium. When a stub file is accessed, device driver software intercepts the access, retrieves the data from its actual location and writes it to the file, then allows the user's access to proceed. Typically, users are unaware that the file's data is stored on a different medium, though they may experience a slight delay when accessing such a file.
File stubbing, the act of creating stub files, is a Hierarchical storage management (HSM) concept.
The usual purpose of stubbing files is to move data from an expensive high-speed storage device such as a computer's hard drive to lower cost storage such as a magnetic tape, or an electro-optical disk, while not requiring users to know how to use specialised storage software to retrieve the data. It also allows a system manager to enforce the use of low cost storage when users would prefer to store their files on the highest availability, and highest cost, media supplied.
Stubbing is a feature of many commercial file backup and archiving packages and is available for Microsoft Windows, Novell NetWare, Linux and other operating systems.