[go: nahoru, domu]

File copying: Difference between revisions

Content deleted Content added
No edit summary
 
(40 intermediate revisions by 29 users not shown)
Line 1:
{{short description|Operation which creates a new digital file with contents identical to another}}
{{Cleanup|date=May 2007}}
{{more citations needed|date=December 2009}}
'''File copying''' is creation of a new [[computer file|file]] which has the same content as an existing file.
{{use dmy dates|date=December 2021|cs1-dates=y}}
{{use list-defined references|date=January 2022}}
 
AllIn digital [[operatingfile systemmanagement]]s include file, '''copying''' inis thea user[[Computer_file#Operations|file interface,operation]] that likecreates "cp"a innew [[UnixComputer file|file]] andwhich "copy"has inthe same content as an existing file. Computer [[MS-DOSoperating system]]s include file copying methods to users; operating systems with [[graphical user interface]]s ([[GUI]]s) usuallyoften provideproviding [[copy-and-paste]] or [[drag-and-drop]] methods of file copying.  Operating systems may have specialized file-copying [[File managerAPI]]s, too,are provideusually anable easyto waytell ofthe server to perform the copying fileslocally, without sending file contents over the network, thus greatly improving performance.
 
== Description ==
Internally, however, while some systems have specialized [[Application programming interface|API]]s for copying files (like CopyFile and CopyFileEx in [[Windows API]]), others (like [[Unix]] and [[MS-DOS]]) fall back to simply reading the contents of the old file and writing it to the new file. This makes little difference with local files, but provides an interesting situation when both the source and target files are located on a remote [[file server]].  Operating systems with specialized file copying APIs are usually able to tell the server to perform the copying locally, without sending file contents over the network, thus greatly improving performance.  Those systems that have no comparable APIs, however, have to read the file contents over the network, and then to send them back, again over the network.  Sometimes remote file copying is performed with a specialized command, like "ncopy" in MS-DOS clients for [[Novell NetWare]].
'''File copying''' is the creation of a new '''copy [[computer file|file]]''' which has the same content as an existing file.
 
=== Shadow ===
An even more complicated situation arises when one needs to copy files between two remote servers.  The simple way is to read data from one server, and then to write them to the second server.  The tricky way is to tell both servers to exchange data directly (and this is hardly implemented anywhere).
There are several different technologies that use the term '''shadowing''', but the intent of shadowing within these technologies is to provide an exact copy (or [[Disk mirroring|mirror]] of a set) of data. For shadowing to be effective, the shadow needs to exist in a separate physical location than the original data. Depending on the [[Disk mirroring|reasons]] behind the shadow operation, this location may be as close as the BIOS chip to the RAM modules, a second harddrive in the same chassis, or as far away as the other side of the globe.
 
== Use ==
All computer [[operating system]]s include file copying provisions in the user interface, like the command, "[[cp (Unix)|cp]]" in [[Unix]] and "[[COPY (command)|COPY]]" in [[DOS]]; operating systems with a [[graphical user interface]], or [[GUI]], usually provide [[copy-and-paste]] or [[drag-and-drop]] methods of file copying.  [[File manager]] applications, too, provide an easy way of copying files.
 
== {{anchor|NCOPY}}Implementation ==
Internally, however, while some systems have specialized [[application programming interface]]s ([[API]]s) for copying files (like CopyFile and CopyFileEx in [[Windows API]]), others (like Unix and DOS) fall back to simply reading the contents of the old file and writing it to the new file.
 
Internally,This however,makes whilelittle somedifference systemswith have specialized [[Application programming interface|API]]s for copyinglocal files (likethose CopyFileon andthe CopyFileExcomputer's inhard [[Windows API]]drive), others (like [[Unix]] and [[MS-DOS]]) fall back to simply reading the contents of the old file and writing it to the new file. This makes little difference with local files, but provides an interesting situation when both the source and target files are located on a remote [[file server]].&nbsp; Operating systems with specialized file copying APIs are usually able to tell the server to perform the copying locally, without sending file contents over the network, thus greatly improving performance.&nbsp; Those systems that have no comparable APIs, however, have to read the file contents over the network, and then to send them back, again, over the network.&nbsp; Sometimes, remote file copying is performed with a specialized command, like "ncopyNCOPY" in MS-DOS clients for [[Novell NetWare]]. The [[COPY (DOS command)|COPY]] command in some versions of [[DR-DOS]] since 1992,<ref name="Caldera_1997_DOSSRC"/> has built-in support for this.
An even more complicated situation arises when one needs to copy files between two remote servers.&nbsp; The simple way is to read data from one server, and then to write themthe data to the second server.&nbsp; The tricky way is to tell both servers to exchange data directly (and this is hardly implemented anywhere).
 
== See also ==
* {{section link|Computer file#Moving methods}}
* [[Core dump]]
* [[Soft copy]]
* [[Hard copy]]
* [[List of file copying software]]
* [[ln (Unix)]]
* [[NTFS junction point]]
* [[Zero copy]]
 
== References ==
{{Reflist|refs=
<ref name="Caldera_1997_DOSSRC">{{cite web |title=Caldera OpenDOS Machine Readable Source Kit (M.R.S) 7.01 |publisher=[[Caldera (company)|Caldera, Inc.]] |date=1997-05-01 |url=https://archive.sundby.com/retro/DR-DOS/dossrc.zip |access-date=2022-01-02 |url-status=live |archive-url=https://web.archive.org/web/20210807095409/https://archive.sundby.com/retro/DR-DOS/dossrc.zip |archive-date=2021-08-07}} [https://web.archive.org/web/20220102102656/https://archive.sundby.com/retro/OpenDOS/OPENDOS_7.01_CODE.ZIP] (NB. Actually implemented since [[DR DOS "Panther"]] on 1992-06-22, see COMCPY.C/DOSIF.ASM in the COMMAND.COM sources of [[OpenDOS 7.01]].)</ref>
}}
 
== Further reading ==
* [http://www.freepatentsonline.com/5043876.html N-level file shadowing and recovery in a shared file system], United States Patent 5043876
* [http://www.freepatentsonline.com/5276871.html Method of file shadowing among peer systems], United States Patent 5276871
* [https://web.archive.org/web/20061127130733/http://www.ibexpert.info/documentation/%20%209.%20IBExpert%20Services%20Menu/%20%202.%20Restore%20Database/%20%201.%20Database%20Shadow%20Files/15713.html Database Shadow Files]
 
== External links ==
* [https://www.gnu.org/software/emacs/manual/html_node/emacs/File-Shadowing.html Instructions on how to shadow files] for [[Emacs]]
{{Computer files}}
 
{{DEFAULTSORT:File Copying}}
[[Category:Computer file systems]]
[[Category:Copyright law]]
{{operating-system-stub}}
 
[[ko:파일 복사]]