Answer the question
In order to leave comments, you need to log in
Why does it take a long time to create a copy of a file?
I create a copy of the wav file, which I pass as an argument to the program. And then I send byte by byte to stdout to a file ( wav > output).
A file of 9 megabytes is created noticeably ... very noticeably longer than just copying in the file manager.
What is the difference between the algorithms?
Answer the question
In order to leave comments, you need to log in
First, if you read and write byte by byte, then the number of system calls is equal to the number of bytes in the file, and each system call is a context switch. Secondly, if the work is carried out from the HDD, then the head rushes from place to place, and its positioning is a hell of a long operation. Thirdly, the file manager most likely does not read or write the file at all, but simply makes one system call, such as splice , and then DMA does the copying.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question