-
symbolic link
軟連接,本質是Unix概念,不是Python概念,
-
link in Unix
A link in UNIX is a pointer to a file.
Like pointers in any programming languages, links in UNIX are pointers pointing to a file or a directory.
Creating links is a kind of shortcuts to access a file.
There are two types of links:
- Soft link or Symbolic links
- Hard Links
These links behave differently when the source of the link is moved or removed.
Symbolic links are not updated(they merely contain a string which is the pathname of its target); hard links always refer to the source, even if moved or removed.
-
Python 相關函式
os.readlink(path) : returns a string representing the path to which the symbolic link points.
os.symlink(src, dst) : create symbolic link.
-
References
- Soft and Hard links in Unix/Linux
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/191954.html
標籤:其他
