Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6741] iOS: Ti.Filesystem.File.size does not work

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-01-30T16:54:22.000+0000
Affected Version/sRelease 1.8.0.1
Fix Version/sSprint 2011-50, Release 1.8.0.1, Release 2.0.0
ComponentsiOS
Labelsparity, verified-1.8.0.1
ReporterStephen Tramer
AssigneeStephen Tramer
Created2011-12-17T15:38:58.000+0000
Updated2012-03-04T21:59:29.000+0000

Description

var win = Titanium.UI.currentWindow;
win.backgroundColor = '#FFFFFF'

var close_button = Titanium.UI.createButton({
    title:'Close'
});

win.leftNavButton = close_button;

close_button.addEventListener('click', function(e) {
    win.close();
});

var file_path = '/media/test_video.mp4'; 

var vf = Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory, file_path);

Ti.API.info ("[test_file_size.js] file: " + file_path);
Ti.API.info ("[test_file_size.js] bytes before read: " + vf.size);


var video_data = vf.read();

Ti.API.info ("[test_file_size.js] bytes after read: " + vf.size);
Ti.API.info ("[test_file_size.js] bytes in buffer: " + video_data.size);
Apparently vf.size is always 0. Naturally we will have to evaluate a different file. Test must go into drillbit. Report from this helpdesk ticket: http://support.appcelerator.com/tickets/APP-321287/tickets

Comments

  1. Stephen Tramer 2011-12-17

    Please run the new drillbit test in addition to manually verifying the size of a file when testing. Drillbit may be modified to include just such a test, but that would require an accurate byte dump to a file directly, which I can't remember how to do in UNIX right now.
  2. Vishal Duggal 2011-12-17

    PR# 1043 fixes bug in Release 1.8.0.1
  3. Michael Pettiford 2011-12-19

    Tested on Ti Studio 1.0.7.201112152014 Ti Mob SDK 1.8.0.1.RC3 OSX Lion iPhone 4S OS 5.0.1 Verified both manually and through drillbit (per Natalie) that the correct file size is output
  4. Michael Pettiford 2012-01-11

    Closing this issue as fixed against 1.8.0.1
  5. Michael Pettiford 2012-01-30

    Reopening/closing to add/remove labels

JSON Source