"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/npm/lib/install/is-fs-access-available.js" (11 Apr 2017, 763 Bytes) of package /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 'use strict'
    2 var fs = require('fs')
    3 var semver = require('semver')
    4 var isWindows = process.platform === 'win32'
    5 
    6 // fs.access first introduced in node 0.12 / io.js
    7 if (!fs.access) {
    8   module.exports = false
    9 } else if (!isWindows) {
   10   // fs.access always works on non-Windows OSes
   11   module.exports = true
   12 } else {
   13   // The Windows implementation of `fs.access` has a bug where it will
   14   // sometimes return access errors all the time for directories, even
   15   // when access is available. As all we actually test ARE directories, this
   16   // is a bit of a problem.
   17   // This was fixed in io.js version 1.5.0
   18   // As of 2015-07-20, it is still unfixed in node:
   19   // https://github.com/joyent/node/issues/25657
   20 
   21   module.exports = semver.gte(process.version, '1.5.0')
   22 }