How would I check for the existence of file in a directory?
I'm thinking I use list option in CFDIRECTORY, but I'm a little stuck on
where to start with this.
I figure I use this statement:
cfdirectory directory=#GetDirectoryFromPath(GetTemplatePath())#
name=myDirectory
and then check for
you could go that route.
but there's also fileExists() :)
On 4/20/05, Robert Orlini [EMAIL PROTECTED] wrote:
How would I check for the existence of file in a directory?
I'm thinking I use list option in CFDIRECTORY, but I'm a little stuck on
where to start with this.
I figure I use
How about the fileExists() built-in function? Just pass it the full
path to the file in question, and it'll return boolean for whether it
exists or not.
cheers,
barneyb
On 4/20/05, Robert Orlini [EMAIL PROTECTED] wrote:
How would I check for the existence of file in a directory?
I'm
Try CFIF FileExists(C:\Inetpub\wwwroot\blank.gif)
Allan
- Original Message -
From: Robert Orlini
To: CF-Talk
Sent: Wednesday, April 20, 2005 8:05 PM
Subject: Check for a file in a directory
How would I check for the existence of file in a directory?
I'm thinking I use
Use the FileExists() function in CFML.
http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/functi79.htm#wp1104406
George
~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking
fileExists()
:-)
--Ben
Robert Orlini wrote:
How would I check for the existence of file in a directory?
I'm thinking I use list option in CFDIRECTORY, but I'm a little stuck on
where to start with this.
I figure I use this statement:
cfdirectory
Thanks all. I read over the link below, however, I need it to monitor this
directory with the use of a form that a user enters the file name so the cfif
IsDefined(FORM.yourFile) will not work.
How can I have it monitor the directory on its own so-to-speak and then tell me
if it finds a certain
You mean like this:
cfif structKeyExists(form, filename)
cfif fileExists(c:\path\to\directory\ form.filename)
File Exists!
cfelse
File Doesn't Exist!
/cfif
/cfif
form method=post action=#cgi.script_name#
input name=filename /
input type=submit /
/form
On 4/20/05, Robert Orlini
Thanks Barney.
Sorry I re-read my previous email and realized I may have worded wrong. I don't
want a form that submits anything. Just a way for the CF script to monitor this
directory for a file and then do a cfif...
-Original Message-
From: Barney Boisvert [mailto:[EMAIL PROTECTED]
Use something like cfdirectory directory=... name=QueryDir
action=list filter=#FORM.filename#
and I believe you can then check QueryDir.recordCount
- Original Message -
From: Robert Orlini [EMAIL PROTECTED]
To: CF-Talk cf-talk@houseoffusion.com
Sent: Wednesday, April 20, 2005
CF scripts only execute based on page requests, either from users or
from scheduled tasks. So CF can't monitor a directory for a
specific file, unless you use an event gateway (only in CF7
Enterprise).
cheers,
barneyb
On 4/20/05, Robert Orlini [EMAIL PROTECTED] wrote:
Thanks Barney.
Sorry I
Thanks
-Original Message-
From: Barney Boisvert [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 20, 2005 2:51 PM
To: CF-Talk
Subject: Re: Check for a file in a directory
CF scripts only execute based on page requests, either from users or
from scheduled tasks. So CF can't monitor a
-Original Message-
From: Barney Boisvert [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 20, 2005 2:51 PM
To: CF-Talk
Subject: Re: Check for a file in a directory
CF scripts only execute based on page requests, either from users or
from scheduled tasks. So CF can't monitor a
I did mention scheduled tasks as a way to initiate a CF page, but I
wasn't very clear with what I was saying overall, was I? With an
event gateway you can actually listen for events and respond, with a
scheduled task you're stuck with polling at a one minute intervals.
So if per-minute checks is
14 matches
Mail list logo