summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2024-04-02 12:44:01 +0200
committerHelmut Grohne <helmut@subdivi.de>2024-04-02 12:44:01 +0200
commitf30371ca43fa423641c7c261b142243f7e1ca920 (patch)
treefd32907381ea9addaacc778c7a43dedb0fd75a4b
parente2bdc8a44687c72c462876eee2b18453dfdef452 (diff)
downloadpython-linuxnamespaces-f30371ca43fa423641c7c261b142243f7e1ca920.tar.gz
add documentation regarding resource management of AtLocations
-rw-r--r--linuxnamespaces/atlocation.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/linuxnamespaces/atlocation.py b/linuxnamespaces/atlocation.py
index 0257014..9e32596 100644
--- a/linuxnamespaces/atlocation.py
+++ b/linuxnamespaces/atlocation.py
@@ -41,6 +41,13 @@ class AtLocation:
filesystem object. Otherwise, the location specifies the filesystem object.
If it is relative, it the anchor is the file descriptor or the current
working directory if the file descriptor is AT_FDCWD.
+
+ There are two ways of managing the closing of file descriptors. One is to
+ treat AtLocation as an object that borrows file descriptors but never
+ closes them and taking care of closing them in some other way. The other is
+ using AtLocation as a context manager and thinking of it as owning a file
+ descriptor. Some methods such as walk dictate a particular lifetime
+ management.
"""
fd: int