[Patches] tempfile: /usr/tmp not FHS-compliant

gerrit@nl.linux.org gerrit@nl.linux.org
Fri, 3 Mar 2000 17:22:41 +0100


--ikeVEW9yuYc//A+q
Content-Type: text/plain; charset=us-ascii

Hello,

the File Hierarchy Standard only counts for Unices, but being
FHS-for-unix-compliant isn't bad on other OS'es. Quoting from the FHS:

3.11  /tmp : Temporary files

The /tmp directory shall be made available for programs that require
temporary files.

Although data stored in /tmp may be deleted in a site-specific manner,
it is recommended that files and directories located in /tmp be deleted
whenever the system is booted.

Programs shall not assume that any files or directories in /tmp are
preserved between invocations of the program.

BEGIN RATIONALE

IEEE standard P1003.2 (POSIX, part 2) makes requirements that are
similar to the above section.

FHS added the recommendation that /tmp be cleaned at boot time on the
basis of historical precedent and common practice, but did not make it a
requirement because system administration is not within the scope of
this standard.

END RATIONALE

.../usr/tmp is old...

The following symbolic links to directories may be present. This
possibility is based on the need to preserve compatibility with older
systems until all implementations can be assumed to use the /var
hierarchy.

    /usr/spool -> /var/spool
    /usr/tmp -> /var/tmp
    /usr/spool/locks -> /var/lock

Once a system no longer requires any one of the above symbolic links,
the link may be removed, if desired.

.../var/tmp is for more persistent temporary files...

5.12  /var/tmp : Temporary files preserved between system reboots

The /var/tmp directory is made available for programs that require
temporary files or directories that are preserved between system
reboots.  Therefore, data stored in /var/tmp is more persistent than
data in /tmp.

Files and directories located in /var/tmp must not be deleted when the
system is booted.  Although data stored in /var/tmp is typically deleted
in a site-specific manner, it is recommended that deletions occur at a
less frequent interval than /tmp.


This patch changes the assignment of the 'attempdirs' list on line 26
to try /tmp first, /var/tmp next and /usr/tmp as third, instead of
/usr/tmp first and /tmp next.

The FHS can be found at:
    
    http://www.pathname.com/fhs/

 ------------------------------------------------------------------
| I confirm that, to the best of my knowledge and belief, this     |
| contribution is free of any claims of third parties under        |
| copyright, patent or other rights or interests ("claims").  To   |
| the extent that I have any such claims, I hereby grant to CNRI a |
| nonexclusive, irrevocable, royalty-free, worldwide license to    |
| reproduce, distribute, perform and/or display publicly, prepare  |
| derivative versions, and otherwise use this contribution as part |
| of the Python software and its related documentation, or any     |
| derivative versions thereof, at no cost to CNRI or its licensed  |
| users, and to authorize others to do so.                         |
|                                                                  |
| I acknowledge that CNRI may, at its sole discretion, decide      |
| whether or not to incorporate this contribution in the Python    |
| software and its related documentation.  I further grant CNRI    |
| permission to use my name and other identifying information      |
| provided to CNRI by me for use in connection with the Python     |
| software and its related documentation.                          |
 ------------------------------------------------------------------

regards,
Gerrit.

-- 
Plies korekt enie bet ingglisj joe encauntur in mai imil mesusj!
-- 
Comparison Python GUI's: http://www.nl.linux.org/~gerrit/gui.html
Please comment!

--ikeVEW9yuYc//A+q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="tempfile.py.diff"

*** /tmp/tempfile.py	Fri Mar  3 17:04:30 2000
--- tempfile.py	Fri Mar  3 17:05:37 2000
***************
*** 23,29 ****
          pwd = os.getcwd()
      except (AttributeError, os.error):
          pwd = os.curdir
!     attempdirs = ['/usr/tmp', '/tmp', pwd]
      if os.name == 'nt':
          attempdirs.insert(0, 'C:\\TEMP')
          attempdirs.insert(0, '\\TEMP')
--- 23,29 ----
          pwd = os.getcwd()
      except (AttributeError, os.error):
          pwd = os.curdir
!     attempdirs = ['/tmp', '/var/tmp', '/usr/tmp', pwd]
      if os.name == 'nt':
          attempdirs.insert(0, 'C:\\TEMP')
          attempdirs.insert(0, '\\TEMP')

--ikeVEW9yuYc//A+q--