House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

using the result of CFDIRECTORY as a list

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
mayo
05/18/2004 12:08 AM

I'm using CFDIRECTORY to get a list of files that meet certain parameters. Sometimes one of the file doesn't exist. And here's the trouble. I can't seem to use CFDIRECTORY as a list. I keep getting the "complex object type" error. I can produce a list of a files that should exist, I would like to compare that to the files that do exist. Been spinning my wheels on this one. Gil Midonnet

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Tony Weeg
05/18/2004 12:11 AM

what happens if you cfdump the results, doesnt it look like a query? can you valueList() the getDirectory_QueryName.fileName or whatever the variable is called to get a list? ....tony Tony Weeg sr. web applications architect navtrak, inc. tony@navtrak.net 410.548.2337 www.navtrak.net I'm using CFDIRECTORY to get a list of files that meet certain parameters. Sometimes one of the file doesn't exist. And here's the trouble. I can't seem to use CFDIRECTORY as a list. I keep getting the "complex object type" error. I can produce a list of a files that should exist, I would like to compare that to the files that do exist. Been spinning my wheels on this one. Gil Midonnet

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
mayo
05/18/2004 12:23 AM

The cfdirectory is below: <cfdirectory   action = "list"   directory = "c:\inetpub\wwwroot\RMG\events"   name = "getFiles"   filter = "_#date#-#id#*.cfm"   sort = "name"   > If I do a #ListLen(eventFiles)# I get the complex object type error. An abbreviated cfdump is below:      ATTRIBUTES DATELASTMODIFIED MODE NAME SIZE TYPE       1 [empty string]  05/17/2004 07:12:11 PM  [empty string] _2004-44-brochure.cfm  79  File Gil   what happens if you cfdump the results, doesnt it look like a query?   can you valueList() the getDirectory_QueryName.fileName   or whatever the variable is called to get a list?   ....tony   Tony Weeg   sr. web applications architect   navtrak, inc.   tony@navtrak.net   410.548.2337   www.navtrak.net   I'm using CFDIRECTORY to get a list of files that meet certain   parameters.   Sometimes one of the file doesn't exist. And here's the trouble. I can't   seem to use CFDIRECTORY as a list. I keep getting the "complex object   type" error.   I can produce a list of a files that should exist, I would like to   compare that to the files that do exist.   Been spinning my wheels on this one.   Gil Midonnet

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Tony Weeg
05/18/2004 12:32 AM

<cfdirectory   action = "list"   directory = "c:\inetpub\wwwroot\RMG\events"   name = "getFiles"   filter = "_#date#-#id#*.cfm"   sort = "name"   >      <cfset mylist = valueList(getFiles.name)>   <cfdump var="#myList#"> now, this doesn't check for a null value in getFiles.name, but you could accomplish that with... <cfif isDefined("getFiles.name") and len(getFiles.name)> ... </cfif> ur welcome ...lettuce and tomato :) Tony Weeg sr. web applications architect navtrak, inc. tony@navtrak.net 410.548.2337 www.navtrak.net The cfdirectory is below: <cfdirectory   action = "list"   directory = "c:\inetpub\wwwroot\RMG\events"   name = "getFiles"   filter = "_#date#-#id#*.cfm"   sort = "name"   > If I do a #ListLen(eventFiles)# I get the complex object type error. An abbreviated cfdump is below:      ATTRIBUTES DATELASTMODIFIED MODE NAME SIZE TYPE       1 [empty string]  05/17/2004 07:12:11 PM  [empty string] _2004-44-brochure.cfm  79  File Gil   what happens if you cfdump the results, doesnt it look like a query?   can you valueList() the getDirectory_QueryName.fileName   or whatever the variable is called to get a list?   ....tony   Tony Weeg   sr. web applications architect   navtrak, inc.   tony@navtrak.net   410.548.2337   www.navtrak.net   I'm using CFDIRECTORY to get a list of files that meet certain   parameters.   Sometimes one of the file doesn't exist. And here's the trouble. I can't   seem to use CFDIRECTORY as a list. I keep getting the "complex object   type" error.   I can produce a list of a files that should exist, I would like to   compare that to the files that do exist.   Been spinning my wheels on this one.   Gil Midonnet

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Tony Weeg
05/18/2004 12:36 AM

also, for clarification, the reason it was bombing is that you were attempting to get the length of a list, through the listLen() function with a complex var.  a structure.  cant do that one. but if you had... <cfif listLen(valueList(getFiles.name))>   ... </cfif> that woulda worked too! ....tony Tony Weeg sr. web applications architect navtrak, inc. tony@navtrak.net 410.548.2337 www.navtrak.net <cfdirectory   action = "list"   directory = "c:\inetpub\wwwroot\RMG\events"   name = "getFiles"   filter = "_#date#-#id#*.cfm"   sort = "name"   >      <cfset mylist = valueList(getFiles.name)>   <cfdump var="#myList#"> now, this doesn't check for a null value in getFiles.name, but you could accomplish that with... <cfif isDefined("getFiles.name") and len(getFiles.name)> ... </cfif> ur welcome ...lettuce and tomato :) Tony Weeg sr. web applications architect navtrak, inc. tony@navtrak.net 410.548.2337 www.navtrak.net The cfdirectory is below: <cfdirectory   action = "list"   directory = "c:\inetpub\wwwroot\RMG\events"   name = "getFiles"   filter = "_#date#-#id#*.cfm"   sort = "name"   > If I do a #ListLen(eventFiles)# I get the complex object type error. An abbreviated cfdump is below:      ATTRIBUTES DATELASTMODIFIED MODE NAME SIZE TYPE       1 [empty string]  05/17/2004 07:12:11 PM  [empty string] _2004-44-brochure.cfm  79  File Gil   what happens if you cfdump the results, doesnt it look like a query?   can you valueList() the getDirectory_QueryName.fileName   or whatever the variable is called to get a list?   ....tony   Tony Weeg   sr. web applications architect   navtrak, inc.   tony@navtrak.net   410.548.2337   www.navtrak.net   I'm using CFDIRECTORY to get a list of files that meet certain   parameters.   Sometimes one of the file doesn't exist. And here's the trouble. I can't   seem to use CFDIRECTORY as a list. I keep getting the "complex object   type" error.   I can produce a list of a files that should exist, I would like to   compare that to the files that do exist.   Been spinning my wheels on this one.   Gil Midonnet

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Maureen
05/18/2004 12:16 AM

CFDIRECTORY with an action of list returns a query set with the query name = to whatever you use in the name attribute.  You can then use this like any other query. cfdirectory Example from Macromedia site: <!--- use cfdirectory to give the contents of the directory that contains this page order by name and size ---> <cfdirectory     directory="#GetDirectoryFromPath(GetTemplatePath())#"     name="myDirectory"     sort="name ASC, size DESC"> <!---- Output the contents of the cfdirectory as a cftable -----> <cftable     query="myDirectory"     htmltable     colheaders>     <cfcol        header="NAME:"        text="#Name#">     <cfcol        header="SIZE:"        text="#Size#"> </cftable> At 12:06 AM 5/18/04, Gil Midonnet wrote: ----- Excess quoted text cut - see Original Post for more -----

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Matthew Walker
05/18/2004 12:14 AM

valuelist(files.name) where files is the name of your cfdirectory query.   _____ Sent: Tuesday, 18 May 2004 4:06 p.m. To: CF-Talk Subject: using the result of CFDIRECTORY as a list I'm using CFDIRECTORY to get a list of files that meet certain parameters. Sometimes one of the file doesn't exist. And here's the trouble. I can't seem to use CFDIRECTORY as a list. I keep getting the "complex object type" error. I can produce a list of a files that should exist, I would like to compare that to the files that do exist. Been spinning my wheels on this one. Gil Midonnet   _____  

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Matthew Walker
05/18/2004 12:38 AM

How could a file not have a name?   _____ Sent: Tuesday, 18 May 2004 4:30 p.m. To: CF-Talk Subject: RE: using the result of CFDIRECTORY as a list <cfdirectory   action = "list"   directory = "c:\inetpub\wwwroot\RMG\events"   name = "getFiles"   filter = "_#date#-#id#*.cfm"   sort = "name"   >      <cfset mylist = valueList(getFiles.name)>   <cfdump var="#myList#"> now, this doesn't check for a null value in getFiles.name, but you could accomplish that with... <cfif isDefined("getFiles.name") and len(getFiles.name)> ... </cfif> ur welcome ...lettuce and tomato :) Tony Weeg sr. web applications architect navtrak, inc. tony@navtrak.net 410.548.2337 www.navtrak.net The cfdirectory is below: <cfdirectory   action = "list"   directory = "c:\inetpub\wwwroot\RMG\events"   name = "getFiles"   filter = "_#date#-#id#*.cfm"   sort = "name"   > If I do a #ListLen(eventFiles)# I get the complex object type error. An abbreviated cfdump is below:      ATTRIBUTES DATELASTMODIFIED MODE NAME SIZE TYPE       1 [empty string]  05/17/2004 07:12:11 PM  [empty string] _2004-44-brochure.cfm  79  File Gil   what happens if you cfdump the results, doesnt it look like a query?   can you valueList() the getDirectory_QueryName.fileName   or whatever the variable is called to get a list?   ....tony   Tony Weeg   sr. web applications architect   navtrak, inc.   tony@navtrak.net   410.548.2337   www.navtrak.net   I'm using CFDIRECTORY to get a list of files that meet certain   parameters.   Sometimes one of the file doesn't exist. And here's the trouble. I can't   seem to use CFDIRECTORY as a list. I keep getting the "complex object   type" error.   I can produce a list of a files that should exist, I would like to   compare that to the files that do exist.   Been spinning my wheels on this one.   Gil Midonnet   _____  

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Tony Weeg
05/18/2004 12:40 AM

if the file doesn't exist. <cfif isDefined("getFiles.name") and len(getFiles.name) and (listLen(valueList(getfiles.name)) gte 1)>   Show the file, its here. <cfelse>   The file isnt here, but here's the file that should be here.    </cfif> but he said he did know the name of what "Should" be there, just had to know if it wasn't...so he could compare with what "should" be there. I think.  I was confused the first time I read it. ....tony Tony Weeg sr. web applications architect navtrak, inc. tony@navtrak.net 410.548.2337 www.navtrak.net How could a file not have a name?   _____ Sent: Tuesday, 18 May 2004 4:30 p.m. To: CF-Talk Subject: RE: using the result of CFDIRECTORY as a list <cfdirectory   action = "list"   directory = "c:\inetpub\wwwroot\RMG\events"   name = "getFiles"   filter = "_#date#-#id#*.cfm"   sort = "name"   >      <cfset mylist = valueList(getFiles.name)>   <cfdump var="#myList#"> now, this doesn't check for a null value in getFiles.name, but you could accomplish that with... <cfif isDefined("getFiles.name") and len(getFiles.name)> ... </cfif> ur welcome ...lettuce and tomato :) Tony Weeg sr. web applications architect navtrak, inc. tony@navtrak.net 410.548.2337 www.navtrak.net The cfdirectory is below: <cfdirectory   action = "list"   directory = "c:\inetpub\wwwroot\RMG\events"   name = "getFiles"   filter = "_#date#-#id#*.cfm"   sort = "name"   > If I do a #ListLen(eventFiles)# I get the complex object type error. An abbreviated cfdump is below:      ATTRIBUTES DATELASTMODIFIED MODE NAME SIZE TYPE       1 [empty string]  05/17/2004 07:12:11 PM  [empty string] _2004-44-brochure.cfm  79  File Gil   what happens if you cfdump the results, doesnt it look like a query?   can you valueList() the getDirectory_QueryName.fileName   or whatever the variable is called to get a list?   ....tony   Tony Weeg   sr. web applications architect   navtrak, inc.   tony@navtrak.net   410.548.2337   www.navtrak.net   I'm using CFDIRECTORY to get a list of files that meet certain   parameters.   Sometimes one of the file doesn't exist. And here's the trouble. I can't   seem to use CFDIRECTORY as a list. I keep getting the "complex object   type" error.   I can produce a list of a files that should exist, I would like to   compare that to the files that do exist.   Been spinning my wheels on this one.   Gil Midonnet   _____  

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
mayo
05/18/2004 12:55 AM

Getting tired ... will .. look ... at ... this ... tomorrow .... thanks all Yes, I know the files which should be there. An event has several files associated with it. Employees should be able to edit these files at will. Sometimes the end users who are adding the files (via CFFILE) are called away and don't finish the process. Events are ongoing and very numerous but the files for each event (overview, location, attendees, etc...) are the same. Events are named YYYY-eventID-overview.cfm, etc... It would be good to have all the files listed whether they are completed or not.  So, if a marketing person didn't have time to complete it s/he could get back to it and see EVENT: Whatever EDIT .... overview .... DateLastModified EDIT .... location .... DateLastModified ADD .... attendees .... - Thanks All Gil Midonnet   if the file doesn't exist.   <cfif isDefined("getFiles.name") and len(getFiles.name) and   (listLen(valueList(getfiles.name)) gte 1)>   Show the file, its here.   <cfelse>   The file isnt here, but here's the file that should be here.   </cfif>   but he said he did know the name of what "Should" be there, just had to   know if it wasn't...so he could   compare with what "should" be there.   I think.  I was confused the first time I read it.   ....tony   Tony Weeg   sr. web applications architect   navtrak, inc.   tony@navtrak.net   410.548.2337   www.navtrak.net   How could a file not have a name?     _____   Sent: Tuesday, 18 May 2004 4:30 p.m.   To: CF-Talk   Subject: RE: using the result of CFDIRECTORY as a list   <cfdirectory     action = "list"     directory = "c:\inetpub\wwwroot\RMG\events"     name = "getFiles"     filter = "_#date#-#id#*.cfm"     sort = "name"     >     <cfset mylist = valueList(getFiles.name)>     <cfdump var="#myList#">   now, this doesn't check for a null value in getFiles.name, but you could   accomplish that with...   <cfif isDefined("getFiles.name") and len(getFiles.name)>   ...   </cfif>   ur welcome   ...lettuce and tomato :)   Tony Weeg   sr. web applications architect   navtrak, inc.   tony@navtrak.net   410.548.2337   www.navtrak.net   The cfdirectory is below:   <cfdirectory     action = "list"     directory = "c:\inetpub\wwwroot\RMG\events"     name = "getFiles"     filter = "_#date#-#id#*.cfm"     sort = "name"     >   If I do a #ListLen(eventFiles)#   I get the complex object type error.   An abbreviated cfdump is below:        ATTRIBUTES DATELASTMODIFIED MODE NAME SIZE TYPE         1 [empty string]  05/17/2004 07:12:11 PM  [empty string]   _2004-44-brochure.cfm  79  File   Gil     what happens if you cfdump the results, doesnt it look like a query?     can you valueList() the getDirectory_QueryName.fileName     or whatever the variable is called to get a list?     ....tony     Tony Weeg     sr. web applications architect     navtrak, inc.     tony@navtrak.net     410.548.2337     www.navtrak.net     I'm using CFDIRECTORY to get a list of files that meet certain     parameters.     Sometimes one of the file doesn't exist. And here's the trouble. I   can't     seem to use CFDIRECTORY as a list. I keep getting the "complex object     type" error.     I can produce a list of a files that should exist, I would like to     compare that to the files that do exist.     Been spinning my wheels on this one.     Gil Midonnet     _____

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Pascal Peters
05/18/2004 05:56 AM

Using <cfdirectory action="list" directory="qList" ...> returns a query, not a list. You should use it as a query. If you absolutly want a list you can do ValueList(qList.name). Be aware that it also lists directories. If you use a filter as you do, this shouldn't be a problem. Pascal ----- Excess quoted text cut - see Original Post for more -----


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

December 19, 2014

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31       

Designer, Developer and mobile workflow conference