I don't understand the "CFFILE is a global scope" part.  The only time that
I know of that it was a problem was in CF pre-7 and when using
action=upload.  In CF7, the "result" attribute was added to the tag for that
action to avoid having to use the unsafe CFFILE scope.  None of the other
cffile and cfdirectory operations required you to use an unsafe scope, as
they all provided for named results where appropriate.

Even so, if you're writing a persistence layer to deal with file-based
persistence, then you're obviously going to have to talk to the file system
at some point.  I guess I just don't understand the question.

Roland

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Barry Beattie
Sent: Tuesday, April 26, 2005 5:42 PM
To: [email protected]
Subject: [CFCDev] cffile/cfdirectory within a DAO

hi all

I'm just about to add xml functionality using cffile, cfdirectory to
the persist layer. (each persist decorates it's service which
decorates a singleton in server scope). The files are on the
webserver, not uploaded.

this is sort of the idea (but the thread petered out...)
http://www.mail-archive.com/[email protected]/msg06983.html

But since CFFILE is a global scope like URL, FORM, or REQUEST (and we
don't break encapsulation by accessing external scopes within a CFC),
I'm a bit unsure if this is actually a good idea.

also, none of the cfc's (so far) access the filesystem directly - and
I'm quite happy about that, especially when it comes to file locking,
etc. If it's database access the persist needs then the db connection
pool will take care of db access - but what about file access in this
case? If any locking is done, it's done at the UI/view layer - there's
no locks within CFC's

any suggestions, etc?
thanx
barry.b

=== persist.cfc ===
getAllXmlFiles(path)
getXmlFile(filename, path)
setXmlFile(filename, path)
deleteXmlFile(filename, path)


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]







----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]


Reply via email to