mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-12 06:52:25 +00:00
Bug 827206 - OS.File.exists for Windows should now work on directories. r=froydnj
This commit is contained in:
parent
e46967256c
commit
4991a52dc6
@ -314,7 +314,7 @@
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks if a file exists
|
||||
* Checks if a file or directory exists
|
||||
*
|
||||
* @param {string} path The path to the file.
|
||||
*
|
||||
@ -322,7 +322,7 @@
|
||||
*/
|
||||
File.exists = function Win_exists(path) {
|
||||
try {
|
||||
let file = File.open(path);
|
||||
let file = File.open(path, FILE_STAT_MODE, FILE_STAT_OPTIONS);
|
||||
file.close();
|
||||
return true;
|
||||
} catch (x) {
|
||||
|
@ -787,5 +787,11 @@ function test_exists_file()
|
||||
info("test_exists_file: starting");
|
||||
ok(OS.File.exists(file_name), "test_exists_file: file exists (OS.File.exists)");
|
||||
ok(!OS.File.exists(file_name + ".tmp"), "test_exists_file: file does not exists (OS.File.exists)");
|
||||
|
||||
let dir_name = OS.Path.join("chrome", "toolkit", "components" ,"osfile",
|
||||
"tests", "mochi");
|
||||
ok(OS.File.exists(dir_name), "test_exists_file: directory exists");
|
||||
ok(!OS.File.exists(dir_name) + ".tmp", "test_exists_file: directory does not exist");
|
||||
|
||||
info("test_exists_file: complete");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user