Learn something new every day
More Info... by email
File copying, in relation to computers, is the process of creating an exact duplicate of the information contained in a computer file. Depending on the operating system or software that is used, the copied file also might contain identical metadata, such as the date of creation, although this information sometimes is not duplicated, specifically to distinguish the copy from the original in some respect. Nearly all operating systems support some form of file copying, with certain systems containing mechanisms that allow for files to be copied from any location, even over a network. Certain complications can occur when performing a file copy, including a name collision in which two files have the same name, and a copy failure in which no file is copied, sometimes because of security restrictions and other times because of hardware factors such as a lack of free disk space.
There are two main ways for a user to perform file copying. The first is to initiate the copy command from a command line interface. This usually involves typing in a command followed by the source file name, and then the destination file name and location. Alternately, file copying more commonly is done through the use of a graphical user interface (GUI) that lets users interact with and see files in a more natural, graphical way. When using a GUI to copy files, the file often is represented by an icon on the screen that can be dragged with a mouse and dropped into a new location.
Although operating systems natively support file copying, separate software applications sometimes are used to help manage the process. This is especially true in cases in which large numbers of files need to be duplicated, which can occupy system resources and make it impossible to use the computer until all of the files are copied. In these instances, some programs are designed either to operate in the background with a low level of priority or have special built-in features such as accelerated copying abilities or a pause function.
From a programming perspective, file copying can be a fairly easy process. The source file is opened and an empty destination file is created. Each byte of the source file is read into a program and then written out to the destination file. The new file will have the exact contents of the source file but might contain different metadata. Most often, this means the date the file was created will match the date the file was copied and may be different from the date the source file actually was created.