If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

File.exists & File.isFile don't work with file in nested dir.

VERIFIED FIXED in M16

Status

Core Graveyard
Installer: XPInstall Engine
P3
major
VERIFIED FIXED
18 years ago
2 years ago

People

(Reporter: David Epstein, Assigned: dbragg)

Tracking

Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

18 years ago
builds 2000-03-07. all platforms. 
1. Go to http://jimbob/trigger2.html
2. Select a_fileop_fileexists from the menu (installs file to "Components"). 
  OR enter a_fileop_fileisfile3.xpi (installs file to "Cool").
3. Trigger.
4. Check HD and logfile.
Result: file installed in nested folder, but:
* return value for routine returns 0 (false). 
* pathway to file is wrong: C:/Program/componentsfileexists.txt (no "/")
Expected:
* return value for routine returns 1 (true). 
* pathway to file is correct: C:/Program/components/fileexists.txt (w/ "/")
 
note: these scripts don't use a slash between the return getFolder() object (f) 
and the appended jarSource file:
  fTemp = f + jarSrc;
  fileSource = getFolder("file:///", fTemp);
  ... File.exists(fileSource);
If we use a "/" between them, this works on NT and Linux, but not Mac. (try 
a_fileop_fileexists2.xpi to see this)
If we use "Program" instead of a nested folder in getFolder() to get the return 
object (f), this works on NT, but not Linux or Mac (try a_fileop_fileexists3.xpi 
or a_fileop_fileisfile.xpi). I'll write a separate bug for this.

Here are the NT logfiles:
(look at "fileexists for file ..." and "fileisfile for file" lines):

-------------------------------------------------------------------------------
http://jimbob/jars/a_fileop_fileexists.xpi  --  03/07/2000 15:29:21
-------------------------------------------------------------------------------

     Acceptance: a_fileop_fileexists
     -------------------------------

     [1/1]	Replacing: C:\Program Files\Netscape\Netscape 
6\components\fileexists.txt

     Install completed successfully
     The fileexists part
     -------------------

     ** Path to fileexists.txt = C:\Program Files\Netscape\Netscape 
6\componentsfileexists.txt
     ** fileExists for file should return 1 (true) = 0
     ** Directory returned = C:\Program Files\Netscape\Netscape 6\
     ** fileExists for directory should return 0 (false) = 1

     Install completed successfully
     Finished Installation  03/07/2000 15:29:21

-------------------------------------------------------------------------------
file:///C|/FileOps/a_fileop_fileisfile/a_fileop_fileisfile3.xpi  --  03/07/2000 
17:54:14
-------------------------------------------------------------------------------

     Acceptance: a_fileop_fileisfile
     -------------------------------

     [1/1]	Installing: C:\Program Files\Netscape\Netscape 
6\Cool\fileisfile.txt

     Install completed successfully
     The fileIsFile part
     -------------------

     ** Path to file = C:\Program Files\Netscape\Netscape 6\Coolfileisfile.txt
     ** fileIsFile should return 1 (true) = false
     ** Path to file = C:\TEMP\
     ** fileIsFile should return 0 (false) = false

     Install completed successfully
     Finished Installation  03/07/2000 17:54:16

Updated

18 years ago
Target Milestone: M15

Updated

18 years ago
Assignee: cathleen → dbragg

Comment 1

18 years ago
reassign to dbragg
bug meeting 3/20

Updated

18 years ago
Depends on: 24984

Comment 2

18 years ago
moving to M16
Target Milestone: M15 → M16

Comment 3

18 years ago
-------------------------------------------------------------------------------
http://jimbob/jars/a_fileop_fileisfile.xpi  --  04/23/2000 21:36:05
-------------------------------------------------------------------------------
 
     Acceptance: a_fileop_fileisfile
     -------------------------------
 
     [1/1]      Replacing: /builds/dougt/mozilla/dist/bin/fileisfile.txt
 
     Install completed successfully, restart required
     The fileIsFile part
     -------------------
 
     ** Path to file = /builds/dougt/mozilla/dist/bin/fileisfile.txt
     ** fileIsFile should return 1 (true) = true
     ** Path to file = /tmp//
     ** fileIsFile should return 0 (false) = false
     Finished Installation  04/23/2000 21:36:06


But notice that g = getFolder("Temporary"); returns an extra slash.  Opening a 
new bug on that (36915).  Marking this paticular bug as fixed.
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED

Comment 4

18 years ago
This bug depends on Bug 23289 to properly verify.  Changing QA Contact to David.
Depends on: 23289
QA Contact: jimmylee → depstein
(Reporter)

Comment 5

18 years ago
fixed. builds 2000-05-09-08-M16.
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.