# Class Storage#statFile

storage

- Defined in: storage.js

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| Storage#statFile(successCallback, errorCallback, options) Gets file stat.

## Class Detail

Storage#statFile(successCallback, errorCallback, options)
Gets file stat. Stat for linked file is not shown.

    function statFile() {
       var successCb = function (cbObject){
         console.log( "Show File Stat: " );
         console.log( JSON.stringify(cbObject));
       };

       var failureCb = function(cbObject){
         var errorCode = cbObject.errorCode;
         var errorText = cbObject.errorText;
         console.log( " Error Code [" + errorCode + "]: " + errorText);
       };

       var options = {
         path: 'file://internal/myFile.txt',
       };

       var storage = new Storage();
       storage.statFile(successCb, failureCb, options);
    }

Parameters:
{Function} successCallback
  success callback function.
{Function} errorCallback
  failure callback function.
{Object} options

  Property | Type | Description | Required
  --- | --- | --- | ---
  path | Storage.SCAP_URI | URI to the resource (internal/usb/sdcard). | required

Since:
  1.2
Returns:

  After the method is successfully executed, successCallback is called with the file stat. Example: { type: file|directory|unknown, size: 527, atime: Mon, 10 Oct 2011 23:24:11 GMT, mtime: Mon, 10 Oct 2011 23:24:11 GMT, ctime: Mon, 10 Oct 2011 23:24:11 GMT } If an error occurs, errorCallback is called with errorCode and errorText. To see how error codes are defined, check Error.ERROR_CODE