Главная страница


ru.perl

 
 - RU.PERL ----------------------------------------------------------------------
 From : Andrew Alakozow                      2:5061/6       12 Apr 2003  19:37:52
 To : Roman Kirjanov
 Subject : Re: tempnam('/tmp', 'foo')
 -------------------------------------------------------------------------------- 
 
 RK> Hужна функция, которая бы придумывала уникальное имя файла в заданном
 RK> каталоге. Думаю, что есть стандартная - в ПХП есть.
 Пример из Perl Cookbook:
 
 use IO::File;
 use POSIX qw(tmpnam);
 
 # try new temporary filenames until we get one that didn't already exist
 do { $name = tmpnam() }
     until $fh = IO::File->new($name, O_RDWR|O_CREAT|O_EXCL);
 
 # install atexit-style handler so that when we exit or die,
 # we automatically delete this temporary file
 END { unlink($name) or die "Couldn't unlink $name : $!" }
 
 # now go on to use the file ...
 
 aa29
 --- Microsoft Outlook Express 6.00.2720.3000
  * Origin: Life In The Dark (2:5061/6)
 
 

Вернуться к списку тем, сортированных по: возрастание даты  уменьшение даты  тема  автор 

 Тема:    Автор:    Дата:  
 Re: tempnam(\'/tmp\', \'foo\')   Andrew Alakozow   12 Apr 2003 19:37:52 
 Re: tempnam(\'/tmp\', \'foo\')   Roman Kirjanov   12 Apr 2003 22:07:35 
 tempnam(\'/tmp\', \'foo\')   ilya voronin   12 Apr 2003 23:19:36 
Архивное /ru.perl/437150d3e0c2c.html, оценка 2 из 5, голосов 10
Яндекс.Метрика
Valid HTML 4.01 Transitional