How are files copied at a low level?

I have a small question:

For example, I use the System.IO.File.Copy () method from the .NET Framework. This method is a managed wrapper for the CopyFile () function of WinAPI. But how does the CopyFile function work? It interacts with the firmware of the HDD or, perhaps, some other operations are performed through Assembler or, perhaps, something else ...

What does it look like from the highest to the lowest?

+3
source share
3 answers

Better to start from the bottom and work up.

Sectors, Tracks Heads. - . - , , , - , .

, , , "" , ,

- , . , , .

, .

, .

, , 10- , 512- , 20 480 "".

, . , , , , / .

. FS , , .

" ", - , , .

, , , 8 3- , 1 2 , . , 1024 . , , . 1 .

" ". "", . , ( " " ). .

"", , , .

, 16, 16 , , " ".

, 16 14 ( ) * 1024 ( ) = 12K. 512 ( ) 24 . 10- 20 480 . 20,480/8 (8 /) 2,560 /512 = 5 .

20,480 , , 29 . 16 , 45 20 480, 20 435 " ".

, 2 , .

, , . . , . 00 00, . , , , .

. (buffer, 10000), , , .

, . TOC. , , , , , . , , .

, TOC , .

, " " - , . , , .

, , , . , 100 , , 512 , "" 101, 100 .

, , , .

, - , ( , ).

+7

, , .

,.NET Framework "" , , . , , .

, . , ​​ , , . Windows Linux, , , , , , . - , .

- , , , , . - , , , (, SATA IDE) .

, : -)

+5

.NET framework API Windows.

Windows API .

Then it depends on the file system in question. Remember that this is not necessarily a “normal” file system on your hard drive; It could even be a shell extension that simply emulates a disk and stores data in your gmail account or something else. The fact is that the same file manipulation functions in the Windows API are used as an abstraction for many possible lower levels of data.

So the answer really depends on which file system you are interested in.

+2
source

Source: https://habr.com/ru/post/1726592/


All Articles