c# - Copy file for read only operations? -
i want copy file bunch of other paths, doing this:
file.copy(instancepath, destpath); but problem file.copy slow (i assume copies file entirely). also, don't need change destination files, read-only references, source can deleted @ time after copy completed.
is there no other way manually copy entire content read operations?
ps
files quite large (> 1gb), copying in 10 places read - expensive.
you don't copy file. create hard link file.
we tend think of file atomic entity on storage device. view quite wrong. files come in multiple parts, metadata, , contents.
in windows, in general, have 1 set of metadata (inode) per file content. ntfs quite possible create multiple inodes resulting in file being accessible in multiple places.
ntfs keep track of how many inodes there each file, , garbage collect on files without inodes. therefore, write process can delete it's inode file without affecting read process, if read process can create hard link original file.
the process of creating hard link extremely quick needing write few kb of data.
Comments
Post a Comment