Title:
Example of FilePath() in documentation uses invalid parameter filePath when it should be file
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/Fixed
Reporter/Name(from Bugbase): Ed B. / ()
Created: 11/27/2019
Components: Documentation, Examples, File Management, CFFile
Versions: 2018
Failure Type:
Found In Build/Fixed In Build: ColdFusion 2018 Update 5 & 6 / CF13
Priority/Frequency: Normal /
Locale/System: / Windows 10 64 bit
Vote Count: 0
Problem Description:
The example shown for FilePath() in the documentation at https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-e-g/fileappend.html incorrectly shows the parameter as filePath when it should be file.
Steps to Reproduce:
<cfscript>
theDir=GetDirectoryFromPath(GetCurrentTemplatePath())
theFolder=theDir & "file.txt"
fileData="The quick brown fox jumps over the lazy dog."
FileAppend(filePath=theFolder,data=fileData,charset="UTF-8",addNewLine="yes")
</cfscript>
Actual Result:
https://cffiddle.org/app/file?filepath=81ae5d05-815f-4c6d-9913-2195d6efc79e/9d7da6c2-5579-4890-9f18-10767f0e641d/91207523-5823-4d04-bd0e-364728b068e1.cfm
Unhandled Exception
Parameter validation error for the FILEAPPEND function.
Type: Template The Valid Parameter for function FILEAPPEND are [file, data, charset, addnewline]
Expected Result:
No Error
Any Workarounds:
https://cffiddle.org/app/file?filepath=a005cf45-0972-4b25-8f16-2d4e3225893e/47ba5661-9490-4a91-a5c1-3b5e8aa24112/c8a85c0c-4467-4228-82b3-0ae1508f2e81.cfm
<cfscript>
theDir=GetDirectoryFromPath(GetCurrentTemplatePath())
theFolder=theDir & "file.txt"
fileData="The quick brown fox jumps over the lazy dog."
FileAppend(file=theFolder,data=fileData,charset="UTF-8",addNewLine="yes")
</cfscript>
Attachments:
Comments: