The LocalFileSystem object is used to supply arguments to DirectoryEntry objects such as the getFile and getDirectory methods, which you can use to look up or create files and directories, respectively.

The following are the properties.

The following is an Example:

// Get the data directory, creating it if it doesn't exist.
dataDirect = fileSystem.root.getDirectory("data", {create: true});
// Create the status file, if and only if it doesn't exist.
statusFile = dataDir.getFile("statusfile.txt", { create: true, exclusive: true });

Using LocalFileSystem

This object provides a way to obtain root filesystems. It has two methods:

Two constants define a local filesystem.

The following is an example that requests the local filesystem:

function onSuccess(fileSystem)
{
console.log(fileSystem.name);
}
// request the persistent file system
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onSuccess, onError);

Here's an example that resolves the local system URI:

function onSuccess(fileEntry)
{
console.log(fileEntry.name);
}
window.resolveLocalFileSystemURI("File:///new.txt", onSuccess, onError);

Full Example

<!DOCTYPE html>
<html>
<head>
<title>Local_File_System Example</title>

<script type="text/javascript" charset="utf-8" src="phonegap-1.3.0.js"></script>
<script type="text/javascript" charset="utf-8">

// Wait for PhoneGap to load
//
document.addEventListener("deviceready", onDeviceReady, false);

// PhoneGap is ready
//
function onDeviceReady() {
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onFileSuccess, fail);
window.resolveLocalFileSystemURI("file://new.txt", onResolveSuccess,fail );
}

function onFileSuccess(fileSystem) {
console.log(fileSystem.name);
}

function onResolveSuccess(fileEntry) {
console.log(fileEntry.name);
}

Resources

Some of the useful resources are as follows:

Working With Networks in Windows Phone 7 Using PhoneGap
Media in PhoneGap
Events in PhoneGap