third_party/gecko-16/win32/bin/components/nsUpdateService.js
/**
 * Tests to make sure that we can write to a given directory.
 *
 * @param updateTestFile a test file in the directory that needs to be tested.
 * @param createDirectory whether a test directory should be created.
 * @throws if we don't have right access to the directory.
 */
Tests to make sure that we can write to a given directory.
@param updateTestFile a test file in the directory that needs to be tested.
@param createDirectory whether a test directory should be created.
@throws if we don't have right access to the directory.
Tests to make sure that we can write to a given directory . @param updateTestFile a test file in the directory that needs to be tested . @param createDirectory whether a test directory should be created . @throws if we don ' t have right access to the directory .
function testWriteAccess(updateTestFile, createDirectory) {
  const NORMAL_FILE_TYPE = Ci.nsILocalFile.NORMAL_FILE_TYPE;
  const DIRECTORY_TYPE = Ci.nsILocalFile.DIRECTORY_TYPE;
  if (updateTestFile.exists())
    updateTestFile.remove(false);
  updateTestFile.create(createDirectory ? DIRECTORY_TYPE : NORMAL_FILE_TYPE,
                        createDirectory ? FileUtils.PERMS_DIRECTORY : FileUtils.PERMS_FILE);
  updateTestFile.remove(false);
}
function testWriteAccess ( updateTestFile , createDirectory ) { const NORMAL_FILE_TYPE = Ci . nsILocalFile . NORMAL_FILE_TYPE ; const DIRECTORY_TYPE = Ci . nsILocalFile . DIRECTORY_TYPE ; if ( updateTestFile . exists ( ) ) updateTestFile . remove ( false ) ; updateTestFile . create ( createDirectory ? DIRECTORY_TYPE : NORMAL_FILE_TYPE , createDirectory ? FileUtils . PERMS_DIRECTORY : FileUtils . PERMS_FILE ) ; updateTestFile . remove ( false ) ; }
Tests to make sure that we can write to a given directory.
Tests to make sure that we can write to a given directory .