Write data to file in Titanium
var configDir = Titanium.Filesystem.getFile( Titanium.Filesystem.applicationDataDirectory, "dirPath" );
if ( configDir.exists() ) {
configDir.createDirectory();
}
var config = Titanium.Filesystem.getFile( configDir.resolve(), "fileName" );
if ( config.write( writeSettingToConfig( userID ) ) == false )
{
// handle write error
var error;
}
config = null;
configDir = null;
if ( configDir.exists() ) {
configDir.createDirectory();
}
var config = Titanium.Filesystem.getFile( configDir.resolve(), "fileName" );
if ( config.write( writeSettingToConfig( userID ) ) == false )
{
// handle write error
var error;
}
config = null;
configDir = null;
Comments
Post a Comment