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
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.
PR# 1043 fixes bug in Release 1.8.0.1
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
Closing this issue as fixed against 1.8.0.1
Reopening/closing to add/remove labels