question about standard directories and file types

This is a discussion on question about standard directories and file types within the Linux Programming forums, part of the Platform Specific Boards category; In windows, we have a couple of directories that are important. Windows directory and Temp directory. Both are guaranteed to ...

  1. #1
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297

    question about standard directories and file types

    In windows, we have a couple of directories that are important. Windows directory and Temp directory. Both are guaranteed to be available for writing no matter what your permissions are. The windows directory is commonly used for settings and shared DLLs and the temp directory is commonly used to store sessional files. here's my questions:

    1. does linux have a temp directory?

    2. .... a directory for storing shared dlls?

    3. .... a directory for storing app settings?

    4. are any of these directories in danger of being bound by some permissions?
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  2. #2
    twm
    twm is offline
    root
    Join Date
    Sep 2003
    Posts
    232
    >1. does linux have a temp directory?
    /tmp
    /var
    /dev/null

    >2. .... a directory for storing shared dlls?
    Nothing universal

    >3. .... a directory for storing app settings?
    App settings? What are you, blind? All of the settings go in the command line options. That, or a text file like all the other config files. Such config files typically go in your home directory, or in the directory of the program in question.

    >4. are any of these directories in danger of being bound by some permissions?
    Yes, but isn't that a good thing?
    The information given in this message is known to work on FreeBSD 4.8 STABLE.
    *The above statement is false if I was too lazy to test it.*
    Please take note that I am not a technical writer, nor do I care to become one.
    If someone finds a mistake, gleaming error or typo, do me a favor...bite me.
    Don't assume that I'm ever entirely serious or entirely joking.

  3. #3
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    >4. are any of these directories in danger of being bound by some permissions?
    Yes, but isn't that a good thing?
    Well, yes and no. In order for certain apps to work they need to be able to write to the file. To store things like last positions, last file opened, etc.

    Is /tmp guaranteed to be writable? Wouldn't seem very useful if it wasn't.
    Last edited by FillYourBrain; 10-08-2003 at 05:24 AM.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  4. #4
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    >3. .... a directory for storing app settings?
    App settings? What are you, blind? All of the settings go in the command line options. That, or a text file like all the other config files. Such config files typically go in your home directory, or in the directory of the program in question.
    What is /etc? It seems like a settings directory
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  5. #5
    twm
    twm is offline
    root
    Join Date
    Sep 2003
    Posts
    232
    >Is /tmp guaranteed to be writable? Wouldn't seem very useful if it wasn't.
    Yes, it's writable by the world. That's why you don't set /tmp as a user's home directory.

    >What is /etc? It seems like a settings directory
    /etc contains configuration files used by the system at startup.
    The information given in this message is known to work on FreeBSD 4.8 STABLE.
    *The above statement is false if I was too lazy to test it.*
    Please take note that I am not a technical writer, nor do I care to become one.
    If someone finds a mistake, gleaming error or typo, do me a favor...bite me.
    Don't assume that I'm ever entirely serious or entirely joking.

  6. #6
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    twm, you say that /tmp is always writable. What other directories are always writable? I will want something to use for global app settings.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  7. #7
    twm
    twm is offline
    root
    Join Date
    Sep 2003
    Posts
    232
    >I will want something to use for global app settings.
    You can make directories you know. Or you can try to adjust the permissions for /usr/local/etc, that's where additional program configuration files are stored. But I don't recommend allowing the world write access to applications used by everyone. You would be better off having global settings that only a superuser can modify and all users can have their own version of those settings in their home directory that override the global settings.
    The information given in this message is known to work on FreeBSD 4.8 STABLE.
    *The above statement is false if I was too lazy to test it.*
    Please take note that I am not a technical writer, nor do I care to become one.
    If someone finds a mistake, gleaming error or typo, do me a favor...bite me.
    Don't assume that I'm ever entirely serious or entirely joking.

  8. #8
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    well that's fair, but is the home directory always writable?

    I'm not arguing here, but I need to solve particular issues. If the home directory is writable I'll probably do it there per-user. However, there may be a global thing or two I want to save out on install (by a "super user"). Where's the most logical place to put that? The install directory? On that note, where is it most acceptable to install? Just wherever they specify or should there be a default place?

    To be fair, I am enjoying linux/X in the development end of things. I am wondering how a non-programmer would get along though. I'm not sure linux is suitable for regular users.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  9. #9
    twm
    twm is offline
    root
    Join Date
    Sep 2003
    Posts
    232
    >well that's fair, but is the home directory always writable?
    By the owner, which should be the user whose home directory it is (unless your system admin hates you ).

    >Where's the most logical place to put that?
    Most extraneous application config and setup files will go in the /usr/local/etc directory, or in a subdirectory of the application in question, such as /usr/local/snoopy/etc for the snoopy program. Pretty much anything not required by the system you want to keep on the /usr filesystem instead of the root filesystem. That way the root filesystem stays as clean as possible. Specifics beyond that are really up to your flavor of Linux and your preferences as a developer.

    >On that note, where is it most acceptable to install?
    Most commonly, /usr/local/bin for the binary.
    The information given in this message is known to work on FreeBSD 4.8 STABLE.
    *The above statement is false if I was too lazy to test it.*
    Please take note that I am not a technical writer, nor do I care to become one.
    If someone finds a mistake, gleaming error or typo, do me a favor...bite me.
    Don't assume that I'm ever entirely serious or entirely joking.

  10. #10
    Registered User
    Join Date
    Jan 2003
    Posts
    88
    store shared libraries in:
    /lib
    /usr/lib
    /usr/local/lib
    /usr/X11R6/lib <-- graphical stuff

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File Directories using I/O
    By legit in forum C++ Programming
    Replies: 12
    Last Post: 06-16-2009, 03:06 PM
  2. Batch file programming
    By year2038bug in forum Tech Board
    Replies: 10
    Last Post: 09-05-2005, 04:30 PM
  3. Listing file in directories
    By Longie in forum C Programming
    Replies: 6
    Last Post: 09-26-2002, 09:56 AM
  4. simulate Grep command in Unix using C
    By laxmi in forum C Programming
    Replies: 6
    Last Post: 05-10-2002, 05:10 PM
  5. Quick Question on File Names and Directories
    By Kyoto Oshiro in forum C++ Programming
    Replies: 4
    Last Post: 03-29-2002, 02:54 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21