E
E
Egorithm2020-07-10 23:38:07
Operating Systems
Egorithm, 2020-07-10 23:38:07

How are files moved between directories at the physical level?

In general, the C++ STL Filesystem simply does not have a function to move files between directories, such as fs::move(). And this, in general, is not a problem, because you can copy and delete. But the point is that I always thought that at the OS level, the movement is not physical, but simply the pointer changes (label, record ... I don’t know how to do it right). Is this just STL cant, or is relocation really achieved by copying and deleting?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2020-07-11
@EgoRusMarch

At the OS level, you need to find out if the file was moved within a partition, or between two partitions.
If within the same section, then the path to the file simply changes. If between partitions, then copying with deletion is performed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question