Closed Bug 476216 Opened 11 years ago Closed 10 years ago

Reading some properties/methods on an nsIFile for large files crashes

Categories

(Firefox :: General, defect, critical)

3.0 Branch
x86
Linux
defect
Not set
critical

Tracking

()

RESOLVED DUPLICATE of bug 389087

People

(Reporter: donrhummy, Unassigned)

Details

User-Agent:       Opera/9.63 (X11; Linux i686; U; en) Presto/2.1.1
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) Gecko/2008121300 Firefox/3.0.5-0.1 Firefox/3.0.5

If I try to read nsIFile.fileSize or nsIFile.isDirectory() on a large file (the one I tried was 3.7 GB), it throws the error:

Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIFile.fileSize]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: file:///home/development/javascript/test.html :: anonymous :: line 1029"  data: no]

Reproducible: Always

Steps to Reproduce:
1. Get a file representation of a LARGE file like:

var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
file.initWithPath( path );

2. Try to read the file size or see if it's a directory like:

if ( file.isDirectory() ) ;

3. Watch it throw an error to the error console
Actual Results:  
Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIFile.fileSize]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: file:///home/development/javascript/test.html :: anonymous :: line 1029"  data: no]

Expected Results:  
Returns either the file size or whether it's a directory (based on which one I called).
Version: unspecified → 3.0 Branch
I'm pretty sure this is a dupe of bug 389087.
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 389087
You need to log in before you can comment on or make changes to this bug.