~/Library/ vs ~/System/Library vs /User/Library/

Discussion in 'Apple' started by justin, Jul 11, 2003.

  1. justin

    justin Guest

    And there is a fourth one in ~/var/root/. I would like to understand in
    which case does a system access or write to a certain Library?

    Logical assumption would be that it depends on the current user, but
    for instance some of the preferences or support files are written to a
    ~/Library regardless of which user is currently logged in.

    I also noticed that if I register an app logged in as an user, I have a
    problem running it as a root. This doesn't seem to be a permission
    issue, rather a support files access problem. But then it sort of
    "goes away" and I can't establish any consistent conclusiion why.

    Is there a definite rule which Library acts as the "current" one and
    which acts as a "global" ? And, since some files, plug ins, fonts etc
    can be placed in either Library, which one is preferred and why?


    Thanks,

    J

    Thanks,

    j
     
    justin, Jul 11, 2003
    #1
    1. Advertisements

  2. justin

    Doug Brown Guest

    First off, you're a little bit confused. ~ means your home directory. So
    the directories are /Library, /System/Library, ~/Library (which is
    /Users/username/Library). The fourth one is just root's ~/Library.
    Prefs that are written into /Library generally are supposed to be shared
    between all users.
    I'm not sure why this is. Some installers will ask if you want to be
    able to use it by all users, or just the current user. But most
    installers don't. :(
    Basically, here's how it goes. Items that are installed in /Library are
    accessible by all users. Items installed in ~/Library
    (/Users/username/Library) are only accessible to that user.
    /System/Library is only for system purposes and should not be modified,
    with one exception (the Extensions folder inside of it, which is where
    kernel extensions are put).

    All three are active at once. But since every different user has their
    own ~/Library, only that user's ~/Library is active. Confusing, but do
    you sort of understand? :)

    Doug
     
    Doug Brown, Jul 11, 2003
    #2
    1. Advertisements

  3. [/QUOTE]

    root is just another user -- albeit a priveleged one on the permissions
    front, and with its users folder hidden away. If you want a facility
    for it, install to it (in which case the goodies go to
    /var/root/Library), or in /Library, where all users can use it.

    [subject corrected; placed in order from Apple-installed to
    machine-specific to user-specific]
     
    David J Richardson, Jul 12, 2003
    #3
  4. justin

    Doug Brown Guest

    root is just another user -- albeit a priveleged one on the permissions
    front, and with its users folder hidden away. If you want a facility
    for it, install to it (in which case the goodies go to
    /var/root/Library), or in /Library, where all users can use it.

    [subject corrected; placed in order from Apple-installed to
    machine-specific to user-specific][/QUOTE]

    Good idea to correct the subject :)

    You may want to watch who you're quoting...I didn't say that; the OP
    did. :)

    Doug
     
    Doug Brown, Jul 12, 2003
    #4
  5. justin

    justin Guest

    You are right, I have "misspelled" the paths with the tilde when I
    actually meant the *root* - as in Mac HD or C:\ or .../ oh well.
    Sorry about that, I do understand the difference.
    Well, I would agree and I thought that is how it should work, but some
    *global* preferences set while logged in as an user will not work when
    logged in as a root. Or the other way around. Whatever the cause is, it
    is frustrating.
    I installed PGP a couple of months ago but I couldn't use it logged
    as a root, I had to manually copy key files to the
    /root/Library/Application support/PGP. Then I deleted all PGP files in
    user/library/app suport to see what happens when looged in as an user -
    and - it worked. ?
    Oh, I do. But because it all works in a "sort of" kinda way 2 weeks
    ago I trashed /Users/* on this machine and I decided to stay
    permanently logged in as a root by default. So far - no more headaches
    and permission screw ups. Maybe Panther will act a bit more Mac-like.


    j.
     
    justin, Jul 12, 2003
    #5
  6. justin

    Simon Slavin Guest

    Don't run applications as root under OS X. It's not designed
    for that. There's never a need to enable the root account for
    an OS X installation.
    It doesn't quite work like that. Think of it like this: for
    any one account, everything from two library directories is
    available: the global one and their own one. If you're putting
    something on your system and you want everyone to be able to
    use it, put it in under the root. If you want only yourself
    to have access to it, put it in your home directory.

    Now I distinguish between /System/Library and /Library: the
    first one is for library routines used by the system: things
    that the system itself needs to work. The second is used for
    things that applications use -- not essential to keep the OS
    working, useful for things that happen once the OS is running.
     
    Simon Slavin, Jul 13, 2003
    #6
  7. Unfortunately, that isn't really true. If you want to manipulate files
    with full root privledges, you either need to learn the command line and
    sudo or do it from the Finder by logging in to the GUI as root.
    Hopefully, some day Apple will have the ability in the Finder to open a
    folder as another user.
     
    Steven Fisher, Jul 14, 2003
    #7
  8. justin

    justin Guest

    root is just another user -- albeit a priveleged one on the permissions
    front, and with its users folder hidden away. If you want a facility
    for it, install to it (in which case the goodies go to
    /var/root/Library), or in /Library, where all users can use it.[/QUOTE]

    I guess I am seeing the problem from a different angle... Lets put it
    this way: Which Library does an app prioritize to read its preferences
    from, "global" or "user" ?

    (For instance, I have BBedit prefs files in all three Libs plus
    registration file in user/Library)

    And - if I am logged in as an user (or root) but applications' files
    were initially stored in /Library during installation - will they
    (preferences) be recreated in the current user (or root) Library?
    Thanks, that looks better. I made an idiot out of myself, didn't I.
    But, wouldn't /System/Library be more machine-specific?

    j.
     
    justin, Jul 14, 2003
    #8
  9. justin

    Anno Siegel Guest

    [snip all to get to this:]
    Going off on a tangent here...

    Unfortunately, parts of the Perl library are also stored in /System/Library.
    There are probably good reasons for this, but the consequence is that
    Perl modules may want to write there during installation. This, in turn,
    means that you have to be root for those installations. Admin privileges
    are good enough for most installations, but not for these.

    Anno
     
    Anno Siegel, Jul 14, 2003
    #9
  10. justin

    Simon Slavin Guest

    'sudo' is fine. I have no problem with sudo. However, using the
    GUI as root is not fine and can lead to problems. For instance,
    imagine opening something in /dev in the Finder and having the
    Finder try to make a .DS_Store file in it.
     
    Simon Slavin, Jul 17, 2003
    #10
  11. justin

    Simon Slavin Guest

    There is no 'prioritize'. Preferences which relate to one user
    only belong in the user's folder, preferences which relate to
    all users belong in a global folder. For example, suppose you
    have an application which comes in 'demo' form and requires
    the entry of a serial number to enable all the features. The
    serial number should be stored in a global preferences file.
    However, if the same application allows different colours for
    its windows, the current colour preferences should be stored
    in each user's folder.

    The application will have to open both preference files to find
    out its current settings.
    No. They're for two different things. And if they're preferences
    which relate to each user individually then it should never have
    stored anything in /Library to start with.
     
    Simon Slavin, Jul 17, 2003
    #11
  12. justin

    justin Guest


    I understand what you are saying but that is not how it works in
    practice. Again, you are talking about where the preferences "belong"
    to and where app "should" not store it's files to - what if they just
    happen to be where they do not belong ?

    Maybe it's the applications' installers to blame, maybe it's unix
    specific, it's ambiguity is indentical to that *other* messy OS, under
    OS9 I know *every* single file on my HD - why it is there and what
    created it.

    For one, an application will authorize itself only to a single user,
    the file will end up in the user's preferences folder, not in the
    /Library. Two, a Mac application can not read preferences from two
    files from two diferent libraries, "interpolating" data or whatever you
    are trying to say. It will read from a *single* file with the most
    recent date. Again, as an example, because I have been logging in both
    as an user and a root, BBEdit has Preferences folder in all *three*
    libraries. This invalidates your statement that applications should
    never write anything to /Library, they do, most notably to Application
    support folder. How do they diferentiate between the libraries - which
    was my original question - is still a mistery to me.

    It would be really "fun" to try user and root install of Potoshop or
    Cubase, both which install specific fonts, drivers, invisibles,
    plug-ins and so on. Unless - is root not suposed to run user installed
    applications ?


    j.
     
    justin, Jul 18, 2003
    #12
  13. justin

    Simon Slavin Guest

    I'm sorry but although you may have a particular application
    which behaves as you say, not all applications behave as you
    say and that application violates the guidelines Apple
    publish about how an application should behave.

    It's possible to write applications which behave any way you
    please. However, the question you appeared to be asking was
    about what the library directories were for, and only Apple
    gets to decide that.
     
    Simon Slavin, Jul 21, 2003
    #13
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.