Closed Bug 1156060 Opened 10 years ago Closed 3 years ago

No macBirthDate or nixBirthDate for OS.File.DirectoryIterator entries nor for OS.File.stat

Categories

(Toolkit Graveyard :: OS.File, defect)

38 Branch
x86_64
Windows 8.1
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: noitidart, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0 Build ID: 20150416143048 Steps to reproduce: Open browser console Enter this code: let iterator = new OS.File.DirectoryIterator(OS.Constants.Path.desktopDir); let prom = iterator.nextBatch().then(x=>console.log('x:',x)) Actual results: http://i.imgur.com/eMJmnir.png On left is mac, middle is windows, right is ubuntu. We see mac and ubuntu have no birthdate. Docs say there should be a macBirthDate but I can't find it. Expected results: birthDate's should be given by iterator entry and also by stat
here is stat on mac: http://i.imgur.com/JjFrICV.png stat on ubuntu: http://i.imgur.com/B6d8UHW.png we see no birthDate
maybe we can also make these functions return an inode for os'es that support it (unix)
Component: Untriaged → OS.File
Product: Firefox → Toolkit
Yoric: Is this a known limitation?
Flags: needinfo?(dteller)
No unixBirthDate is normal, as the information is not available under Linux, even at low-level. No macBirthDate, however, is a bug. The worker API has it (https://dxr.mozilla.org/mozilla-central/source/toolkit/components/osfile/modules/osfile_unix_front.jsm#887) but we do not have any test for the main thread API.
Flags: needinfo?(dteller)
Thanks guys, what is an alternative for unixBirthDate for unix devs? Ill note this on the docs. As when i needed it, i couldnt out what was the next best alt.
I don't know of any alternative, even at low-level. I don't think that the file system actually holds the information.
Noida, if you're interested, I can mentor you in fixing the absence of `macBirthDate`.
Flags: needinfo?(noitidart)
(In reply to David Rajchenbach-Teller [:Yoric] (use "needinfo") from comment #7) > Noida, if you're interested, I can mentor you in fixing the absence of > `macBirthDate`. Thanks Yoric I would really love to because I want to fix the isSymlink bug as thats not working either. And then i want to implement shortcut for windows and possibly hardlink instead of unixSymlink. And maybe add something in for unix users to use. And maybe possibly (if you guys agree) merge the js-ctypes version of the file watching, I don't know if you guys want it to jsctypes though. What's the first step to take to fix this macBirthDate? Thanks!
Flags: needinfo?(noitidart)
(In reply to David Rajchenbach-Teller [:Yoric] (use "needinfo") from comment #7) > Noida, if you're interested, I can mentor you in fixing the absence of > `macBirthDate`. Hey yoric i built firefox, i think im ready now :)
Also it looks like we can get the creation time on unix, we just have to detect the file system and use the per-filesystem method: http://stackoverflow.com/a/10172234/1828637 `````` UFS2 / st_birthtime ZFS / crtime Ext4 / crtime btrfs / otime HFS+ / ? ``````
Ooops forgot to need info you :) Im ready to go got Firefox built and even set up visual studio (and practiced my first C++) today in case i need to do C++ or C stuff.
Ooops forgot to need info you :) Im ready to go got Firefox built and even set up visual studio (and practiced my first C++) today in case i need to do C++ or C stuff.
Flags: needinfo?(dteller)
Flags: needinfo?(dteller)

OSFIle is being replaced with IOUtils and PathUtils.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → WONTFIX
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.