Welcome to NeoOffice developer notes and announcements
NeoOffice
Developer notes and announcements
 
 

This website is an archive and is no longer active
NeoOffice announcements have moved to the NeoOffice News website


Support
· Forums
· NeoOffice Support
· NeoWiki


Announcements
· Twitter @NeoOffice


Downloads
· Download NeoOffice


  
NeoOffice :: View topic - My /var/tmp is full of junk
My /var/tmp is full of junk
 
   NeoOffice Forum Index -> OpenOffice.org X11 Development
View previous topic :: View next topic  
Author Message
Terry Teague
Guest





PostPosted: Mon Jul 19, 2004 12:43 am    Post subject: My /var/tmp is full of junk

I was debugging a non-OpenOffice.org project the other day when I discovered a bunch of stuff in "/var/tmp". Some of it belonged to the project I was debugging, but the majority of it appeared to be from the OpenOffice.org project.

Specifically I am talking about temporary directories of the form :

Code:
sv001.tmp

On some of my systems, I have dozens of these directories. Almost always the contents have a creation date of 1969. I don't have handy the combined size of these directories.

I believe these directories are created by use of the mktemp() type functions, except I thought mktemp() defaulted to "/tmp" and not "/var/tmp".

Bottom line, "/tmp" is always cleared on a reboot, but "/var/tmp" is never cleared. Eventually one's disk could fill up with this useless junk.

So I went and looked at :

http://porting.openoffice.org/mac/macosx_issues.html

which says :

Quote:
Bugs in tempnam() and mktemp() system functions

In Mac OS X 10.0.x, multiple invocations of either the tempnam() or mktemp() system functions will return the same filename. On other platforms, these functions generate a unique filename with each invocation. This Mac OS X 10.0.x bug will cause unpredictable results at runtime.

The solution is to use the tmpnam() function instead of the tempnam() function and to use the mkstemp() function instead of the mktemp() function. Both tmpnam() and mkstemp() return a unique filename with each invocation. Note that since the default behavior for both tmpnam() and mkstemp() is to create their files in the /var/tmp directory, you need to make sure that the /var/tmp directory is readable and writable by all users. The Mac OS X 10.0.x installation program, /var/tmp is set to be readable and writable only by root.

I'm wondering if we still need to use this workaround in OpenOffice.org (and in case it is used in the OOo installer) now we no longer support anything earlier than Mac OS X 10.2.x.

Opinions?

Regards, Terry
Back to top
Display posts from previous:   
   NeoOffice Forum Index -> OpenOffice.org X11 Development All times are GMT - 7 Hours
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © Planamesa Inc.
NeoOffice is a registered trademark of Planamesa Inc. and may not be used without permission.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.