Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python os.pathconf()键及其含义_Python_Unix_Constants - Fatal编程技术网

Python os.pathconf()键及其含义

Python os.pathconf()键及其含义,python,unix,constants,Python,Unix,Constants,(或与之相同)只是含糊地暗示一组钥匙,其含义在其他地方有明确规定 返回与命名文件相关的系统配置信息名称指定要检索的配置值;它可以是一个字符串,是定义的系统值的名称;许多标准(POSIX.1、Unix 95、Unix 98和其他标准)都指定了这些名称。一些平台还定义了其他名称。主机操作系统已知的名称在pathconf\u name字典中给出 因此,我可以获取并检查pathconf_名称 >>> import os >>> print os.pathconf_na

(或与之相同)只是含糊地暗示一组钥匙,其含义在其他地方有明确规定

返回与命名文件相关的系统配置信息<代码>名称指定要检索的配置值;它可以是一个字符串,是定义的系统值的名称;许多标准(POSIX.1、Unix 95、Unix 98和其他标准)都指定了这些名称。一些平台还定义了其他名称。主机操作系统已知的名称在
pathconf\u name
字典中给出

因此,我可以获取并检查
pathconf_名称

>>> import os
>>> print os.pathconf_names
{'PC_MAX_INPUT': 3, 'PC_VDISABLE': 9, 'PC_SYNC_IO': 25,
'PC_NAME_MAX': 4, 'PC_MAX_CANON': 2, 'PC_PRIO_IO': 19,
'PC_CHOWN_RESTRICTED': 7, 'PC_ASYNC_IO': 17, 'PC_NO_TRUNC': 8,
'PC_FILESIZEBITS': 18, 'PC_LINK_MAX': 1, 'PC_PIPE_BUF': 6,
'PC_PATH_MAX': 5}
猜猜这些标签是什么意思。但是我应该去哪里查找它们的精确语义呢?标签明确针对该接口;搜索
PC\u LINK\u MAX
会显示(原文如此!)1和Ruby等的日文页面,但没有具体介绍Python或“某些平台还定义了其他名称”的含义。这篇TutorialsPoint文章是关于Python的:但它只是一篇教程

我在哪里可以找到这个接口的有用文档,特别是关于Python在各种平台上提供哪些标签,以及它们的值意味着什么

(Python文档中说“Availability:Unix”,这显然在一定程度上限制了可能的平台集。澄清“某些平台”在这里的含义将是一个不错的奖励。)


  • 甚至比微软还要厉害的是,IBM似乎在运行一个链接机器人,它会在任何人注意到任何内容时立即移动任何链接到的内容;因此,URL现在不太可能再起作用了。对不起
  • 从:

    • \u PC\u LINK\u MAX返回指向文件的最大链接数。如果fd或path引用一个目录,则该值应用于整个目录 目录相应的宏是_POSIX_LINK_MAX

    • \u PC\u MAX\u CANON返回格式化输入行的最大长度,其中fd或path必须指向终端。相应的宏是 _POSIX_MAX_佳能

    • \u PC\u MAX\u INPUT返回输入线的最大长度,其中fd或path必须指终端。相应的宏是 _POSIX_最大输入
    • \u PC\u NAME\u MAX返回允许进程创建的目录路径或fd中文件名的最大长度。相应的 宏是_POSIX_NAME_MAX
    • \u PC\u PATH\u MAX当PATH或fd是当前工作目录时,返回相对路径名的最大长度。相应的宏 是_POSIX_PATH_MAX
    • \u PC\u PIPE\u BUF返回管道缓冲区的大小,其中fd必须指管道或FIFO,path必须指FIFO。相应的 宏是_POSIX_PIPE_BUF
    • \u PC\u CHOWN\u RESTRICTED如果不能在此文件上使用CHOWN(2)调用,则返回非零。如果fd或path引用一个目录,那么 适用于该目录中的所有文件。相应的宏是 _POSIX_CHOWN_受限制
    • \u PC\u NO\u TRUNC如果访问长度超过\u POSIX\u NAME\u MAX的文件名会产生错误,则返回非零。相应的宏是_POSIX_NO_TRUNC
    • \u PC_VDISABLE如果可以禁用特殊字符处理,则返回非零,其中fd或path必须指向终端
    从:


    @伯汉哈利德,谢谢!你想把它作为一个答案,这样我就可以接受了吗?Posix平台(只需放下电脑,找到定义)八个月后,IBM链接仍然有效。哇,我猜他们的机器人出了故障?注意,在许多平台上,结果可能是假的,也可能是无限的。
     _PC_LINK_MAX
         The maximum file link count.
    
     _PC_MAX_CANON
         The maximum number of bytes in terminal canonical input line.
    
     _PC_MAX_INPUT
         The minimum maximum number of bytes for which space is available
         in a terminal input queue.
    
     _PC_NAME_MAX
         The maximum number of bytes in a file name.
    
     _PC_PATH_MAX
         The maximum number of bytes in a pathname.
    
     _PC_PIPE_BUF
         The maximum number of bytes which will be written atomically to a
         pipe.
    
     _PC_CHOWN_RESTRICTED
         Return 1 if appropriate privilege is required for the chown(2)
         system call, otherwise 0.  IEEE Std 1003.1-2001 (``POSIX.1'')
         requires appropriate privilege in all cases, but this behavior
         was optional in prior editions of the standard.
    
     _PC_NO_TRUNC
         Return greater than zero if attempts to use pathname components
         longer than {NAME_MAX} will result in an [ENAMETOOLONG] error;
         otherwise, such components will be truncated to {NAME_MAX}.  IEEE
         Std 1003.1-2001 (``POSIX.1'') requires the error in all cases,
         but this behavior was optional in prior editions of the standard,
         and some non-POSIX-compliant file systems do not support this
         behavior.
    
     _PC_VDISABLE
         Returns the terminal character disabling value.
    
     _PC_ASYNC_IO
         Return 1 if asynchronous I/O is supported, otherwise 0.
    
     _PC_PRIO_IO
         Returns 1 if prioritised I/O is supported for this file, other-
         wise 0.
    
     _PC_SYNC_IO
         Returns 1 if synchronised I/O is supported for this file, other-
         wise 0.
    
     _PC_ALLOC_SIZE_MIN
         Minimum number of bytes of storage allocated for any portion of a
         file.
    
     _PC_FILESIZEBITS
         Number of bits needed to represent the maximum file size.
    
     _PC_REC_INCR_XFER_SIZE
         Recommended increment for file transfer sizes between
         _PC_REC_MIN_XFER_SIZE and _PC_REC_MAX_XFER_SIZE.
    
     _PC_REC_MAX_XFER_SIZE
         Maximum recommended file transfer size.
    
     _PC_REC_MIN_XFER_SIZE
         Minimum recommended file transfer size.
    
     _PC_REC_XFER_ALIGN
         Recommended file transfer buffer alignment.
    
     _PC_SYMLINK_MAX
         Maximum number of bytes in a symbolic link.
    
     _PC_ACL_EXTENDED
         Returns 1 if an Access Control List (ACL) can be set on the spec-
         ified file, otherwise 0.
    
     _PC_ACL_NFS4
         Returns 1 if an NFSv4 ACLs can be set on the specified file, oth-
         erwise 0.
    
     _PC_ACL_PATH_MAX
         Maximum number of ACL entries per file.
    
     _PC_CAP_PRESENT
         Returns 1 if a capability state can be set on the specified file,
         otherwise 0.
    
     _PC_INF_PRESENT
         Returns 1 if an information label can be set on the specified
         file, otherwise 0.
    
     _PC_MAC_PRESENT
         Returns 1 if a Mandatory Access Control (MAC) label can be set on
         the specified file, otherwise 0.
    
     _PC_MIN_HOLE_SIZE
         If a file system supports the reporting of holes (see lseek(2)),
         pathconf() and fpathconf() return a positive number that repre-
         sents the minimum hole size returned in bytes.  The offsets of
         holes returned will be aligned to this same value.  A special
         value of 1 is returned if the file system does not specify the
         minimum hole size but still reports holes.