@@ -1675,6 +1675,9 @@ msgid ""
16751675"the function prefixed with ``f`` (e.g. call ``fchdir`` instead of "
16761676"``chdir``).)"
16771677msgstr ""
1678+ "**指定文件描述符为参数:** 通常在 :mod:`os` 模块中提供给函数的 *path* "
1679+ "参数必须是表示文件路径的字符串,但是,某些函数现在可以接受其 *path* 参数为打开文件描述符,该函数将对描述符指向的文件进行操作。(对于 POSIX"
1680+ " 系统,Python 将调用以 ``f`` 开头的函数变体(如调用 ``fchdir`` 而不是 ``chdir``)。)"
16781681
16791682#: ../../library/os.rst:1492
16801683msgid ""
@@ -1683,12 +1686,15 @@ msgid ""
16831686"this functionality is unavailable, using it will raise a "
16841687":exc:`NotImplementedError`."
16851688msgstr ""
1689+ "可以用 :data:`os.supports_fd` 检查某个函数在你的平台上是否支持将 *path* "
1690+ "参数指定为文件描述符。如果不支持,使用该功能将抛出 :exc:`NotImplementedError` 异常。"
16861691
16871692#: ../../library/os.rst:1497
16881693msgid ""
16891694"If the function also supports *dir_fd* or *follow_symlinks* arguments, it's "
16901695"an error to specify one of those when supplying *path* as a file descriptor."
16911696msgstr ""
1697+ "如果该函数还支持 *dir_fd* 或 *follow_symlinks* 参数,那么用文件描述符作为 *path* 后就不能再指定上述参数了。"
16921698
16931699#: ../../library/os.rst:1502
16941700msgid ""
@@ -1699,13 +1705,18 @@ msgid ""
16991705"will call the variant of the function with an ``at`` suffix and possibly "
17001706"prefixed with ``f`` (e.g. call ``faccessat`` instead of ``access``)."
17011707msgstr ""
1708+ "**基于目录描述符的相对路径:** 如果 *dir_fd* 不是 ``None``,它就应该是一个指向目录的文件描述符,这时待操作的 path "
1709+ "应该是相对路径,相对路径是相对于前述目录的。如果 path 是绝对路径,则 *dir_fd* 将被忽略。(对于 POSIX 系统,Python "
1710+ "将调用该函数的变体,变体以 ``at`` 结尾,可能以 ``f`` 开头(如调用 ``faccessat`` 而不是 ``access``)。"
17021711
17031712#: ../../library/os.rst:1509
17041713msgid ""
17051714"You can check whether or not *dir_fd* is supported for a particular function"
17061715" on your platform using :data:`os.supports_dir_fd`. If it's unavailable, "
17071716"using it will raise a :exc:`NotImplementedError`."
17081717msgstr ""
1718+ "可以用 :data:`os.supports_dir_fd` 检查某个函数在你的平台上是否支持 *dir_fd*。如果不支持,使用该功能将抛出 "
1719+ ":exc:`NotImplementedError` 异常。"
17091720
17101721#: ../../library/os.rst:1515
17111722msgid ""
0 commit comments