cffile write nameconflict skip

Description

When nameconflict is set to skip it is still overwriting. However, on our production systems we have errors in the log that are being raised that indicate that the file already exists - production is on 5.2.1.9
The behaviour of overwriting is occurring on 5.2.4.37
<cffile action="write" output="Check123" file="#expandPath('./')#doiexist.txt" charset="utf-8" nameconflict="skip">

<cfoutput>
#expandPath("./")#doiexist.txt<br>
</cfoutput>

Environment

Linux

Activity

Show:
Pothys - MitrahSoft
December 7, 2017, 11:00 AM

I've analyzed this ticket & added test case for this ticket. In cffile tag action="write", nameconflict="skip" & nameconflict="error", overwrites the file content same as ACF does. In lucee action="upload" nameConflict working as expected. I think NameConflict work's only for file action = upload, But I'm not sure about that will confirm this issue.

Pull Request: https://github.com/lucee/Lucee/pull/347

Pat Moody
December 8, 2017, 12:55 AM

Overwriting when set to skip or error does not sound correct to me. Same rules should apply to writing a file - whatever the action is. On a clustered server environment a file might be updated from one server whilst doing a check for existence from another. Should the existence return negative and by the time we do a subsequent write on the second server the file may already be there, so we need to skip.

Michael Offner
September 5, 2018, 6:48 AM
Fixed

Assignee

Michael Offner

Reporter

Pat Moody

Priority

Major

Labels

None

Fix versions

Affects versions