Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18108] Deprecate Ti.Filesystem.File.rename, or make it the same as Ti.Filesystem.File.move

GitHub Issuen/a
TypeImprovement
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.4.1
Fix Version/sn/a
ComponentsTiAPI
Labelsn/a
ReporterTony Lukasavage
AssigneeUnknown
Created2014-11-29T15:09:27.000+0000
Updated2018-02-28T19:54:53.000+0000

Description

According to the documentation, the Ti.Filesystem.File.rename() function does exactly the same thing as the Ti.Filesystem.File.move() function, except that rename has the added stipulation that the file must still reside in the current directory after the rename. Considering that pretty much every system in the world that implements rename and move gives them the exact same functionality, our implementation is confusing and prone to unnecessary mistakes. I would propose one of two solutions:

*Deprecate and eventually remove Ti.Filesystem.File.rename.* All it is is an under-powered, error-prone version of move. There's literally no reason for it functionality-wise. We should phase it out and remove it entirely.

*Give Ti.Filesystem.File.rename the same exact functionality as Ti.Filesystem.File.move.* This would keep both functions, breaking no existing code, but would have them both behave exactly the same way, meeting the world's expectations of what these functions do. It leaves us with redundant APIs, but it seems making no breaking changes and removing this confusing difference between the 2 might be the best choice.

Comments

No comments

JSON Source