PR_GetFileInfo64 behavior different on Windows

UNCONFIRMED
Assigned to

Status

NSPR
NSPR
UNCONFIRMED
3 years ago
3 years ago

People

(Reporter: Ashwani Kadian, Assigned: Wan-Teh Chang)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0
Build ID: 20150105205548

Steps to reproduce:

Call PR_GetFileInfo64() on Windows with filename="d:/ranajit/ws70/6860680/iplanet/ias/server/work/b1/winnt4.0_dbg.obj/https-test/docs/hello.jsp::$DATA".


Actual results:

PR_GetFileInfo64() treated the filename as a data stream and returned PR_SUCCESS if the physical file does not exist.


Expected results:

On Unix, specifying a filename of a non-eixsting file results in PR_FAILURE of  PR_GetFileInfo64() which is correct. Same should have happened on Windows as well but it returned PR_SUCCESS.
(Reporter)

Comment 1

3 years ago
Following is the testcase to reproduce the issue :

---------------------------------------------------------------------------
#include <windows.h>
#include "nspr.h"
#include <iostream>
using namespace std;

int main(int argc, char** argv)
{
    PRFileInfo64 finfo;
    if (PR_GetFileInfo64(argv[1], &finfo) != PR_SUCCESS) {
        cout << "PR_GetFileInfo64 failed for file " << argv[1] << " ++\n";
    }
    else {
        cout << "PR_GetFileInfo64 succeeded for file " << argv[1] << " ++\n";
    }
    return 0;
}
--------------------------------------------------
(Reporter)

Updated

3 years ago
Summary: PR_GetFileInfo64 → PR_GetFileInfo64 behavior different on Windows
You need to log in before you can comment on or make changes to this bug.