Skip to main content.
home | support | download

Back to List Archive

Re: swish-e can't create temporary file

From: Mark A. Malloy <markm(at)>
Date: Fri Apr 30 2004 - 18:10:54 GMT
I had a thought regarding why it might be failing on the 252nd file, 
which seems to be only touched but not written to.  If my limit is set 
somewhere in the Solaris O/S to 256 files then could SWISH-E have open:

   251 temp files (swtmploc*)
   2 index files (.index and .prop)


That just seems overly convenient that it matches up to 256 and then 
dies, but I don't know if I'm overlooking something.  Are there any open 
file limits in Solaris 8 that default to 256?  I thought that 1024 was 
the default, but if something is 256 that might be the bottleneck in 
this case.

- Mark

Bill Moseley wrote:
> 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.
Received on Fri Apr 30 11:10:54 2004