zoukankan      html  css  js  c++  java
  • NSSearchPathDomainMask 详解

    public struct NSSearchPathDomainMask : OptionSetType {

        public init(rawValue: UInt)    

        public static var UserDomainMask: NSSearchPathDomainMask { get } // user's home directory --- place to install user's personal items

        public static var LocalDomainMask: NSSearchPathDomainMask { get } // local to the current machine --- place to install items available to everyone on this machine (/Library)

        public static var NetworkDomainMask: NSSearchPathDomainMask { get } // publically available location in the local area network --- place to install items available on the network (/Network)

        public static var SystemDomainMask: NSSearchPathDomainMask { get } // provided by Apple, unmodifiable (/System)

        public static var AllDomainsMask: NSSearchPathDomainMask { get } // all domains: all of the above and future items

    }

    在这个enum中列举了目录的domain,

    UserDomainMask是指/user/<userid>/目录,

    LocalDomainMask,官方文档说是Local to the current machine—the place to install items available to everyone on this machine.还是不太好理解,应该就是跟UserDomainMask相对的一个概念,UserDomainMask是针对当前用户的,而LocalDomainMask是针对所有用户的,比如Library目录,如果是针对用户的,就是/user/<userid>/Library,而对所有用户的就是/Library。

    NetworkDomainMaskt是指/Network目录下的文件夹。

    SystemDomainMask是系统目录,现在的Mac在/System目录下只有一个Library目录,这个目录下包含了系统运行的程序和文件。并且所有的SystemDomain的文件夹都是只读的。

    其实这个enum定义的是domain的概念,不能简单的理解为某个文件夹下的文件,比如SystemDomainMask中的Application目录是/Applications,Document目录是/System/Library/Documentation,其实这就没什么意义,因为这个文件夹根本不存在。

  • 相关阅读:
    Python_Crawler_Foundation1-2_MYSQL_Regular Expression
    Linux_Best Practice_01_Ubuntu_set prox_set Repositories
    python_Note_Preview_01
    Python_Note_Day 10_Coroutine
    Python_Note_Day 9_threading.Thread_multiprocessing.Process_Queue
    Linux_学习_Day4_user/group/permission
    Linux_学习_Day3_bash
    Linux_学习_Day2~3
    Python_Note_Day 8_socket
    Python_Note_Day 7_Advanced Class
  • 原文地址:https://www.cnblogs.com/xilanglang/p/5154180.html
Copyright © 2011-2022 走看看