Getting the timestamp of a local file - Titanium.Filesystem.File.createTimestamp
Hello Appcelerator Community,
im trying to get the timestamp of the creation date of a File.
But when im using the Function createTimestamp() im getting the error:
Type error:Cannot find function creatTimestamp in object ti.modules.titanium.filesystem FileProxy@43ba7e00
Is something wrong in my code below?
I appreciate any help :)
var file = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,filename);
if ( file.exists() )
{
timeStampOfFile = file.createTimestamp();
}
7 Answers
-
Oddly enough, I'm not getting the error, but when I try, it just seems to only ever return '1'.
-
When i call both variables as properties of Titanium.Filesystem.File:
modificationTimestamp
The return result is null or undefined.
If i use both (modificationTimestamp and createTimestamp) as function calls i always get the error :
Log :: exception TypeError: Cannot call property modificationTimestamp in object ti.modules.titanium.filesystem.FileProxy@43b89598. It is not a function, it is object.
-
Im using a "workaround" now.
Im storing the Date Value im getting via the Server Response in a text file which is named like the xml file but without the xml ending (replace it with .txt)
Then i read the content of the text file at the next request.
But unfortunately im gettting another problem then with setRequestHeader and "If-Modified-Since"… -
Same here…
not getting any error, but only return '1' for both createTimestamp & modificationTimestamp.Bug???
-
It should be resolved in the 1.4.0 Version:
https://appcelerator.lighthouseapp.com/projects/32238/tickets/1340-getting-the-timestamp-of-a-local-file-titaniumfilesystemfilecreatetimestamp
-
I'm having the same problem with both createTimestamp() and modificationTimestamp() returning "1". Any ideas?
Edit: Am using 1.4 and still getting this.
-
Too bad… just upgraded to 1.4.0 and this issue is still there :(
Still getting "1"