Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing a file with a unique name

Status
Not open for further replies.

ice78991

Programmer
Nov 20, 2006
216
I am trying to write a series of files. I would like coldfusion to generate unique file names for me, but the code below simply overwrites

<cffile action="write" nameconflict="MakeUnique" file="#getDirectoryFromPath(getTemplatePath())#file.txt" output="the content">

Is it possible to achieve this or should I do the following

<cffile action="write" nameconflict="MakeUnique" file="#getDirectoryFromPath(getTemplatePath())##CreateUUID()#.txt" output="the content">
 
<cffile action = "write"
file = "full_path_name"
output = "content"
mode = "permission"
addNewLine = "Yes" or "No"
attributes = "file_attributes">

I don't think nameconflict is an avaliable attribute when using the "write" action.

You'll have to determine the unique filename and pass it within the file attribute.



Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top