开发者

Changing the filename of a memory mapped file

开发者 https://www.devze.com 2023-01-13 03:39 出处:网络
Is it possible to cha开发者_如何学JAVAnge the name of an already open memory mapped file, or, do I need to close it, rename it and then mmap it again?Renaming a file while it is open is fine, regardle

Is it possible to cha开发者_如何学JAVAnge the name of an already open memory mapped file, or, do I need to close it, rename it and then mmap it again?


Renaming a file while it is open is fine, regardless of whether it is mmaped or not.

In UNIX-like systems, the concept of the file itself is distinct from the name (which is called a "link"). A file may have zero, one, or many separate names. When you have a file open, it is the file itself that you have a reference to - it's OK to change or remove the name (and the file will remain open).

0

精彩评论

暂无评论...
验证码 换一张
取 消