How to create an unique temporary file?

Author Message

Jerome Despatis

Friday 01 July 2011 5:59:24 am

Is there in eZ API a magic function to do that ?

for now I use tempnam('/tmp', ...)

=> I guess /tmp is not the appropriate place to put the file... Maybe eZSys::varDirectory() is *the* place to use?

=> a better function than tempnam ? maybe better to use eZClusterFileHandler?

Thanks for your help

Jérôme Vieilledent

Friday 01 July 2011 6:29:30 am

Hi Jerome

It's actually up to you and what you need. If your temporary file needs to be used by several servers, then you indeed must use eZClusterFileHandler API.

If not, I'd better chosse the eZSys::varDirectory() approach you mention :). Don't forget to delete your temp file once you don't need it anymore !

Jerome Despatis

Friday 01 July 2011 6:43:43 am

Ok I understand

thanks

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.