Getting a name for a mkfifo

David Faure faure at kde.org
Sat Aug 6 17:15:07 CEST 2005


On Saturday 06 August 2005 16:21, Tomas Mecir wrote:
> On 8/6/05, Piotr Szymański <niedakh at gmail.com> wrote:
> > Hi,
> > What class in KDE do I need to get a decent not taken name for a mkfifo, i'd
> > use KTempFile, but it creates a file there right? Any ideas?
> 
> man 3 tmpnam
> man 3 tempnam

Both say:
BUGS
       Never use this function.

so don't. Use the name provided by a KTempFile. It still leaves a small race condition
though, since you have to let it delete the file before you can create the fifo,
but well, we do that already in KDE (e.g. KParts::ReadWritePart::prepareSaving).

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).



More information about the Kde-soc mailing list