OS/Linux
Linux filesystem mechnism (cp, mv)
무대포개발자
2016. 7. 6. 09:48
http://unix.stackexchange.com/questions/49299/what-is-linux-doing-differently-that-allows-me-to-remove-replace-files-where-win 참조
http://unix.stackexchange.com/questions/50466/how-does-cp-handle-open-files 참조
https://lists.mindrot.org/pipermail/openssh-unix-dev/2011-April/029487.html (cp 는 lock 이 안걸린다.)
요약하면 Linux 에서 파일을 지우거나 복사할 때 Lock 이 안걸린다. 그 이유는 delete 하는 과정은 Link counter를 지우고 file record에서 제거하는 작업이지. Lock을 걸고 하는 작업이 아니다.
cp를 할 때 open 된 파일을 기다리지 않음. 그냥 복사함.