lkml.org 
[lkml]   [1998]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: predictable filenames problem
Date
Tudor Hulubei writes ("predictable filenames problem"):
>
> On the predictable filenames issue: anyone considered having a system
> call that creates a temporary file that doesn't have a directory entry
> (just allocates an inode for it on the file system and returns a file
> descriptor)?

There is already a libc function that opens a file without the
application having to chose a filename - see 'man tmpfile'. Of course,
the temporary file is present in /tmp for a short time, but it's not a
problem provided that the libc implementation is safe.

(A quick examination of the libc5 source reveals that tmpfile opens a
file with flags O_CREAT|O_EXCL and permissions 0666; it relies on your
umask being conservative to keep temporary data private.)

Having a system call would make tmpfile more efficient, but I can't
think of any programs creating so many temporary files that a system
call would make a noticable difference.

Peter

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:41    [W:0.205 / U:0.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site