Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7119] iOS: Filesystem.getFile() - path always relative to Resources instead of calling context

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionWon't Do
Resolution Date2020-01-09T19:36:44.000+0000
Affected Version/sRelease 1.8.0.1
Fix Version/sn/a
ComponentsiOS
Labelsparity
ReporterBill Dawson
AssigneeIngo Muschenetz
Created2012-01-11T16:46:10.000+0000
Updated2020-01-09T19:36:44.000+0000

Description

If a relative path is passed as the first argument to Ti.Filesystem.getFile(..), that path is interpreted differently, android vs. iOS: * In Android, it's relative to the calling context. So if the getFile is called from within a window with JS url "a/b/c.js", then the path argument to getFile (if relative) is interpreted as being relative to folder "b". * In iOS, a relative path passed as first argument to getFile is interpreted as being relative to root Resources, no matter which code is calling it.

Fail Case / Test Case App

Attached GetFilePath.zip contains app that, when run on Android, will show a graphic on the _second_ window. On iPhone, it won't show the graphic and you'll see "ERROR Couldn't get image file" in console.

Attachments

FileDateSize
GetFilePath.zip2012-01-11T17:09:43.000+00005037712

Comments

  1. Arthur Evans 2012-01-12

    Based on discussions in today's parity meeting, there seems to be agreement that Android's current behavior is the correct one (paths are relative to the current script). I'm changing this to an iOS bug and updating the docs accordingly.
  2. Alan Hutton 2020-01-09

    It has been decided that this issue should be closed as “Won’t do.” This issue is out of date with our current supported SDK release (7.5.2.GA as of the date of closure), and out of date with mobile OS versions. If community members feel that the issue is still valid, please create a new ticket. Please reference this closed ticket number, include SDK used, comments, and code that demonstrates/reproduces the issue.

JSON Source