Skip to main content.
home | support | download

Back to List Archive

Re: swish-e can't create temporary file

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Fri Apr 30 2004 - 17:49:12 GMT
On Fri, Apr 30, 2004 at 09:02:14AM -0700, Mark A. Malloy wrote:
> I'm having some problems getting SWISH-E to run using the '-e' flag 
> under Solaris 8 on a SunBlade 100 (Sparc).
[...]
> 
> At first, using the '-e' flag would give me the 'too many open files' 
> error but I ran 'ulimit -n 1000' to raise the limit imposed by bash and 
> it seemed to be the solution.
> 
> Next, the index run would die with this error
> 
> -----
> err: Couldn't create the temporary file '.swtmplocXXXXXX' file 
> descriptor: No such file or directory
> -----
> 
> The XXXXXX changes for each run but two things seem consistent: 1) 252 
> swtmploc* files are created before the failure, and 2) the file that 
> causes the error has been created and is empty.

Hi Mark,

I'm just wildly guessing here.  Where are the files begin created?  On
/tmp?  That is, what's your current directory.

I'm not sure (from reading the man page) if you can trust that "No such
file or directory" message.  It's returning -1 and my man page just
says that "no suitable file could be created" -- well, I think we
realize that.  


Solaris uses tmpfs on some systems, IIRC, for /tmp so maybe it's an
issue with the way that file system operates -- if you are indeed trying
to create files in /tmp.  I frankly can't believe that creating three
hundred files would be a problem, though, regardless of the file system.

Swish-e uses mkstemp() to create the temporary file.  Since I'm in the
guessing phase, I'd probably write a small program that uses mkstemp()
to try and duplicate the error outside of swish.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>

int main( void )
{
   int i;
   char name[1000];
   for ( i=0; i < 1000; i++ ) 
   {
       strcpy( name, ".testXXXXXX" );
       int fd = mkstemp( name );
       if ( -1 == fd ) 
       {
           printf("Failed on file number %d: %s\n", i, strerror(errno) );
           return 1;
       }
   }
   printf("Created %d files\n", i );
   return 0;
}

Wish I had an answer for you.  Please post back what you find.

-- 
Bill Moseley
moseley@hank.org
Received on Fri Apr 30 10:49:13 2004