FileMove() is unable to move a file with the read-only file attribute

Description

The FileMove() function has a difference in behaviour between Lucee and Adobe ColdFusion and Windows O/S.

When the file has the READ-ONLY attribute set, in Lucee it is not possible to move the file as it throws an exception. Windows and Adobe CF both allow the file move in the same circumstance.

The intention of the READ-ONLY attribute is that you cannot write to or modify the file, but should not prevent a move of the file's location.

I believe the issue is in FileTag.java on line 484 - it should not be performing the check on source.isWriteable().

https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/FileTag.java#L484

Activity

Show:
Pothys - MitrahSoft
June 28, 2019, 3:37 PM

I've added a test case, fix for this ticket & confirmed the issue happened on lucee. We can't able to move the file from source to destination with a read-only mode. ACF works as expected. , you are right the attribute doesn't a matter for the action move for a file.

Pull request: https://github.com/lucee/Lucee/pull/705

Michael Offner
January 24, 2020, 9:58 AM

Fixed

Assignee

Michael Offner

Reporter

Ben Reid

Labels

Sprint

None

Affects versions

Priority

Major
Configure