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.

eZ debug

Timing: Jan 18 2025 02:44:43
Script start
Timing: Jan 18 2025 02:44:43
Module start 'layout'
Timing: Jan 18 2025 02:44:43
Module start 'content'
Timing: Jan 18 2025 02:44:44
Module end 'content'
Timing: Jan 18 2025 02:44:44
Script end

Main resources:

Total runtime0.8704 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 589.8047152.6406
Module start 'layout' 0.00620.0034 742.445339.4688
Module start 'content' 0.00950.8590 781.9141506.4609
Module end 'content' 0.86860.0017 1,288.37508.1563
Script end 0.8703  1,296.5313 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.4070160.0002
Check MTime0.00150.1764160.0001
Mysql Total
Database connection0.00080.090110.0008
Mysqli_queries0.809693.0170570.0142
Looping result0.00070.0776550.0000
Template Total0.825194.820.4125
Template load0.00250.291720.0013
Template processing0.822594.506620.4113
Template load and register function0.00020.026710.0002
states
state_id_array0.00280.321010.0028
state_identifier_array0.00120.142820.0006
Override
Cache load0.00200.2242170.0001
Sytem overhead
Fetch class attribute can translate value0.00070.081020.0004
Fetch class attribute name0.00290.331340.0007
XML
Image XML parsing0.00120.132920.0006
class_abstraction
Instantiating content class attribute0.00000.000840.0000
General
dbfile0.00100.1113170.0001
String conversion0.00000.001240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs