[TIMOB-1340] Getting the timestamp of a local file - Titanium.Filesystem.File.createTimestamp
| GitHub Issue | n/a | 
|---|---|
| Type | Bug | 
| Priority | Trivial | 
| Status | Closed | 
| Resolution | Fixed | 
| Resolution Date | 2011-04-17T01:55:54.000+0000 | 
| Affected Version/s | n/a | 
| Fix Version/s | Release 1.4.0 | 
| Components | Android | 
| Labels | android, createtimestamp, defect, ti.modules.titanium.filesystem, titanium.filesystem.file | 
| Reporter | marco.schierhorn (at gmail) | 
| Assignee | Don Thorp | 
| Created | 2011-04-15T02:49:51.000+0000 | 
| Updated | 2011-04-17T01:55:54.000+0000 | 
Description
Im trying to get the timestamp of the creation date of a
File.
But when im using the Function createTimestamp() im getting the
error:
italicType error:Cannot find function createTimestamp in object ti.modules.titanium.filesystem FileProxy@43ba7e00italic
Im reporting this issue on Android using Titanium SDK 1.3.0 and
Android SDK 2.1.
Currently im only testing it on the SDK/Emulator and not on a real
phone.
Is something wrong in my code below?
var file = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,filename);
    if ( file.exists() )
    {
        timeStampOfFile = file.createTimestamp();
    }
modificationTimestamp was missing as well. Note on Android file stored in Resources have no accessible timestamp. These methods may only be used for files written to the device/emulator.
(from [569f3e768e745ac3294308e17550be6bdf312919]) [#1340 state:resolved] exposed support for createTimestamp and modificationTimestamp on the File proxy. Note: files in the Resources folder will not have timestamps when compiled for device. http://github.com/appcelerator/titanium_mobile/commit/569f3e768e745ac3294308e17550be6bdf312919"> http://github.com/appcelerator/titanium_mobile/commit/569f3e768e745...
Just upgraded to 1.4.0 and at least on iPhone this method still return simply "1"
...am I doing something wrong?
Joe, This is an Android Ticket. Please open up a Q&A or HelpDesk item for iPhone. Thanks
Seems to work fine for me now (Android)
Sorry guys... QA is here http://developer.appcelerator.com/question/44101/getting-the-timestamp-of-a-local-file---titaniumfilesystemfilecreatetimestamp"> http://developer.appcelerator.com/question/44101/getting-the-timest... , I'll open a tkt as well