[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)

(Assignee)

Description

6 years ago
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)
(Assignee)

Updated

6 years ago
Summary: GetDiskSpaceAvailable works only on nsILocalFile representing folders → [win] GetDiskSpaceAvailable works only on nsILocalFile representing folders
(Assignee)

Comment 1

6 years ago
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
(Assignee)

Comment 2

6 years ago
tentatively taking
Assignee: nobody → mak77
Flags: in-testsuite?
(Assignee)

Comment 3

6 years ago
Created attachment 555580 [details] [diff] [review]
patch v1.0
Attachment #555580 - Flags: review?(jmathies)
(Assignee)

Updated

6 years ago
Summary: [win] GetDiskSpaceAvailable works only on nsILocalFile representing folders → [win] GetDiskSpaceAvailable doesn't work on files
(Assignee)

Updated

6 years ago
Blocks: 674210

Updated

6 years ago
Attachment #555580 - Flags: review?(jmathies) → review+
(Assignee)

Comment 4

6 years ago
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
(Assignee)

Updated

2 years ago
Flags: in-testsuite? → in-testsuite+
You need to log in before you can comment on or make changes to this bug.