|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
using the result of CFDIRECTORY as a list
I'm using CFDIRECTORY to get a list of files that meet certain parameters.mayo 05/18/04 12:08 A what happens if you cfdump the results, doesnt it look like a query?Tony Weeg 05/18/04 12:11 A The cfdirectory is below:mayo 05/18/04 12:23 A <cfdirectoryTony Weeg 05/18/04 12:32 A also, for clarification, the reason it was bombing is thatTony Weeg 05/18/04 12:36 A CFDIRECTORY with an action of list returns a query set with the query nameMaureen 05/18/04 12:16 A valuelist(files.name) where files is the name of your cfdirectory query.Matthew Walker 05/18/04 12:14 A How could a file not have a name?Matthew Walker 05/18/04 12:38 A if the file doesn't exist.Tony Weeg 05/18/04 12:40 A Getting tired ... will .. look ... at ... this ... tomorrow ....mayo 05/18/04 12:55 A Using <cfdirectory action="list" directory="qList" ...> returns a query,Pascal Peters 05/18/04 05:56 A 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 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 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 <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 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 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 ----- 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 _____ 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 _____ 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 _____ 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 _____ 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 -----
|
September 09, 2010
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||