You are here: How do I creat temp file in php? « All PHP « IT news, forums, messages
How do I creat temp file in php?

Posted by Dave (from the UK) on 05/20/06 18:45

I want to create a temporary file using php on a UNIX computer running
Apache. I have at the minute something like this below.

$inputfile="/tmp/foo";
$handle = fopen($inputfile, 'w');
fwrite($handle, $cmd);

etc

But if two people access the web page, they both create the file
/tmp/foo and so one will corrupt the other as data is written into it.

Can a create a unique temp file, then remove it when finished with it?


--
Dave K MCSE.

MCSE = Minefield Consultant and Solitaire Expert.

Please note my email address changes periodically to avoid spam.
It is always of the form: month-year@domain. Hitting reply will work
for a couple of months only. Later set it manually.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация