[win] GetDiskSpaceAvailable doesn't work on files

RESOLVED FIXED in mozilla9

Status

()

Core
XPCOM
RESOLVED FIXED
6 years ago
2 years ago

People

(Reporter: mak, Assigned: mak)

Tracking

Trunk
mozilla9
All
Windows 7
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

This works:
Components.utils.import("resource://gre/modules/Services.jsm"); var profile = Services.dirsvc.get("ProfD", Components.interfaces.nsILocalFile); profile.diskSpaceAvailable;

This returns 0:
Components.utils.import("resource://gre/modules/Services.jsm"); var file = Services.dirsvc.get("ProfD", Components.interfaces.nsILocalFile); file.append("places.sqlite"); file.diskSpaceAvailable;

It returns 0 because GetDiskFreeSpaceExW returns 0 (thus it fails)
Summary: GetDiskSpaceAvailable works only on nsILocalFile representing folders → [win] GetDiskSpaceAvailable works only on nsILocalFile representing folders
and that is not so wrong since the first argument to GetDiskFreeSpaceExW is lpDirectoryName... it must be a directory, probably if the nsILocalFile is a file we should rather query its parent directory
tentatively taking
Assignee: nobody → mak77
Flags: in-testsuite?
Created attachment 555580 [details] [diff] [review]
patch v1.0
Attachment #555580 - Flags: review?(jmathies)
Summary: [win] GetDiskSpaceAvailable works only on nsILocalFile representing folders → [win] GetDiskSpaceAvailable doesn't work on files
Blocks: 674210

Updated

6 years ago
Attachment #555580 - Flags: review?(jmathies) → review+
http://hg.mozilla.org/integration/mozilla-inbound/rev/7dab2bc1cc91
Whiteboard: [inbound]
http://hg.mozilla.org/mozilla-central/rev/7dab2bc1cc91
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla9
Flags: in-testsuite? → in-testsuite+
You need to log in before you can comment on or make changes to this bug.