Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10711] iOS: read() method of filesystem not returning blob type for text file

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionWon't Fix
Resolution Date2017-07-26T23:45:36.000+0000
Affected Version/sRelease 3.0.0, Release 3.1.0
Fix Version/sn/a
ComponentsiOS
Labelsapi, qe-ios082012
ReporterShyam Bhadauria
AssigneeEric Merriman
Created2012-08-30T05:00:05.000+0000
Updated2017-07-26T23:45:36.000+0000

Description

This is not a regression. It exists as far as 2.0.1. This issue also occurs on android. Steps to reproduce: 1) Use the code below and copy the attached text file in the resource directory.
var win  = Ti.UI.createWindow({
    backgroundColor: 'white'
});
win.open();
 
var f = Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory, 'text.txt');
	
	var contents = f.read();
	Ti.API.info("contents blob object = "+ contents);
	Ti.API.info('contents = ' + contents.text);
2. Notice the logs Expected result: Logs should display results like [INFO] contents blob object = [object TiBlob] [INFO] contents = Hello World. this is a filesystem read test. Actual result: Logs display [INFO] contents blob object = Hello World. this is a filesystem read test. [INFO] contents = Hello World. this is a filesystem read test. Expected results are seen when image file is used instead of text file.

Attachments

FileDateSize
text.txt2012-08-30T05:07:53.000+000044

Comments

  1. Shameer Jan 2013-04-09

    Issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 iOS iPhone Simulator: iOS SDK version: 6.0
  2. Lee Morris 2017-07-26

    Closing due to inactivity. If this issue still exists, please raise a new ticket.

JSON Source