Copying or Moving Titanium Folders

Looking for away to Copy or Move a folder in your Titanium app?  Check out Dossier an all JavaScript module that provides a cross-platform API for working with folders.

Where to get it

The Dossier module, example app.js and supporting files are available at

How it works

Dossier is all JavaScript making it simple to both use and modify.  Simply copy the dossier.js CommonJS module into your app and start coding.

Below is a sample app.js showing Dossier in action.

//Create our application namespace
var my = {};
//Import the module
my.dossier = require('dossier');'Copy one directory to another');

//Create our source and target directory paths
var sourceDir = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'SampleData');
var targetDir = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory + '/NewSampleData');'Copying ' + sourceDir.nativePath + ' to ' + targetDir.nativePath );
my.dossier.copy(sourceDir.nativePath,targetDir.nativePath);'List all the contents of ' + targetDir.nativePath);
var listTargetContents = my.dossier.listContents(targetDir.nativePath);'Move ' + sourceDir.nativePath + ' to ' + targetDir.nativePath );
my.dossier.move(sourceDir.nativePath,targetDir.nativePath);'List all the contents of ' + targetDir.nativePath);
listTargetContents = my.dossier.listContents(targetDir.nativePath);

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s