Closed Bug 1145885 Opened 10 years ago Closed 3 years ago

OS.File.stat isSymlink made with OS.File.unixSymlink doesnt work

Categories

(Toolkit Graveyard :: OS.File, defect)

37 Branch
x86_64
Windows 8.1
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: noitidart, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0 Build ID: 20150316202753 Steps to reproduce: On Mac OS X 10.10.1 Open scratchpad, run this code, it creates an alias file on desktop to /application/Firefox.app --------------- Cu.import('resource://gre/modules/osfile.jsm'); var pathToTarget = OS.Path.join(OS.Constants.Path.macLocalApplicationsDir, 'Firefox.app'); var pathToAlias = OS.Path.join(OS.Constants.Path.desktopDir, 'ff.link'); //extension is .link, the file must not exist or unixErrno 17 ocurs var promise_alias = OS.File.unixSymLink(pathToTarget, pathToAlias) promise_alias.then( function(aVal) { console.log('Promise Fullfilled - promise_alias - ', aVal); }, function(aReason) { console.error('Promise Rejected - promise_alias - ', aReason); } ); --------------- Then stat this file and we see that isSymLink returns false: ------------------- Cu.import('resource://gre/modules/osfile.jsm'); var pathToAlias = OS.Path.join(OS.Constants.Path.desktopDir, 'ff.link'); //extension is .link, the file must not exist or unixErrno 17 ocurs var promise_alias = OS.File.stat(pathToAlias) promise_alias.then( function(aVal) { console.log('Promise Fullfilled - promise_alias - ', aVal, 'isSymLink:', aVal.isSymLink); }, function(aReason) { console.error('Promise Rejected - promise_alias - ', aReason); } ); -------------- Actual results: .isSymLink returns false Expected results: .isSymLink should return true
Component: Untriaged → OS.File
Product: Firefox → Toolkit
Using nsIFile on the created Alias works succesfully. --------------- var pathToAlias = OS.Path.join(OS.Constants.Path.desktopDir, 'ff.link'); var nsifile = new FileUtils.File(pathToAlias); nsifile.isSymlink(); // returns true nsifile.target; // returns the real target ---------------------------------

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.