Osmose / advanced-open-file

Open files and folders in Atom easily.
https://atom.io/packages/advanced-open-file
Other
118 stars 20 forks source link

Uncaught Error: EPERM: operation not permitted, stat 'C:\Config.Msi' #76

Closed tintoy closed 8 years ago

tintoy commented 8 years ago

Hi.

Steps to reproduce:

  1. Press Ctrl-Alt-O, advanced-open-file-dialog is displayed.
  2. Simultaneously, the above error message is also displayed.

FWIW, that folder is a system folder (Windows Installer file cache for rolling back failed installations). Ordinary users are not meant to have access to this folder. Since I didn't try to navigate to it, this error message should not be displayed.

Atom Version: 1.2.4 System: Microsoft Windows 10 Pro Thrown From: advanced-open-file package, v0.13.0

Stack Trace

Uncaught Error: EPERM: operation not permitted, stat 'C:\Config.Msi'

At /C:/Users/tintoy/.atom/packages/advanced-open-file/lib/models.js:197

Error: EPERM: operation not permitted, stat 'C:\Config.Msi'
    at Error (native)
    at fs.statSync (fs.js:854:18)
    at Object.fs.statSync (ATOM_SHELL_ASAR.js:225:16)
    at Path.get (C:/Users/tintoy/.atom/packages/advanced-open-file/lib/models.js:41:6)
    at Path.descriptor.get (C:/Users/tintoy/.atom/packages/advanced-open-file/lib/utils.js:15:46)
    at Path.isDirectory (C:/Users/tintoy/.atom/packages/advanced-open-file/lib/models.js:53:20)
    at C:/Users/tintoy/.atom/packages/advanced-open-file/lib/view.js:199:62
    at Array.filter (native)
    at AdvancedOpenFileView.setPathList (C:/Users/tintoy/.atom/packages/advanced-open-file/lib/view.js:199:40)
    at AdvancedOpenFileController.updatePath (C:/Users/tintoy/.atom/packages/advanced-open-file/lib/controller.js:90:36)
    at AdvancedOpenFileController.pathChange (C:/Users/tintoy/.atom/packages/advanced-open-file/lib/controller.js:71:10)
    at C:/Users/tintoy/.atom/packages/advanced-open-file/lib/view.js:132:17
    at Emitter.module.exports.Emitter.emit (C:\Users\tintoy\AppData\Local\atom\app-1.2.4\resources\app.asar\node_modules\event-kit\lib\emitter.js:86:11)
    at C:\Users\tintoy\AppData\Local\atom\app-1.2.4\resources\app.asar\src\text-editor.js:211:32
    at Emitter.module.exports.Emitter.emit (C:\Users\tintoy\AppData\Local\atom\app-1.2.4\resources\app.asar\node_modules\event-kit\lib\emitter.js:86:11)
    at DisplayBuffer.module.exports.DisplayBuffer.emitDidChange (C:\Users\tintoy\AppData\Local\atom\app-1.2.4\resources\app.asar\src\display-buffer.js:312:20)
    at DisplayBuffer.module.exports.DisplayBuffer.updateScreenLines (C:\Users\tintoy\AppData\Local\atom\app-1.2.4\resources\app.asar\src\display-buffer.js:1251:19)
    at DisplayBuffer.module.exports.DisplayBuffer.handleTokenizedBufferChange (C:\Users\tintoy\AppData\Local\atom\app-1.2.4\resources\app.asar\src\display-buffer.js:1213:19)
    at C:\Users\tintoy\AppData\Local\atom\app-1.2.4\resources\app.asar\src\display-buffer.js:5:61
    at Emitter.module.exports.Emitter.emit (C:\Users\tintoy\AppData\Local\atom\app-1.2.4\resources\app.asar\node_modules\event-kit\lib\emitter.js:86:11)
    at TokenizedBuffer.module.exports.TokenizedBuffer.handleBufferChange (C:\Users\tintoy\AppData\Local\atom\app-1.2.4\resources\app.asar\src\tokenized-buffer.js:393:27)
    at C:\Users\tintoy\AppData\Local\atom\app-1.2.4\resources\app.asar\src\tokenized-buffer.js:69:24
    at Emitter.module.exports.Emitter.emit (C:\Users\tintoy\AppData\Local\atom\app-1.2.4\resources\app.asar\node_modules\event-kit\lib\emitter.js:86:11)
    at TextBuffer.module.exports.TextBuffer.applyChange (C:\Users\tintoy\AppData\Local\atom\app-1.2.4\resources\app.asar\node_modules\text-buffer\lib\text-buffer.js:645:20)
    at TextBuffer.module.exports.TextBuffer.revertToCheckpoint (C:\Users\tintoy\AppData\Local\atom\app-1.2.4\resources\app.asar\node_modules\text-buffer\lib\text-buffer.js:799:16)
    at TextBuffer.module.exports.TextBuffer.transact (C:\Users\tintoy\AppData\Local\atom\app-1.2.4\resources\app.asar\node_modules\text-buffer\lib\text-buffer.js:768:14)
    at TextEditor.module.exports.TextEditor.transact (C:\Users\tintoy\AppData\Local\atom\app-1.2.4\resources\app.asar\src\text-editor.js:1152:26)
    at C:\Users\tintoy\AppData\Local\atom\app-1.2.4\resources\app.asar\src\text-editor.js:765:24
    at TextEditor.module.exports.TextEditor.mergeSelections (C:\Users\tintoy\AppData\Local\atom\app-1.2.4\resources\app.asar\src\text-editor.js:2017:18)
    at TextEditor.module.exports.TextEditor.mergeIntersectingSelections (C:\Users\tintoy\AppData\Local\atom\app-1.2.4\resources\app.asar\src\text-editor.js:1979:35)
    at TextEditor.module.exports.TextEditor.mutateSelectedText (C:\Users\tintoy\AppData\Local\atom\app-1.2.4\resources\app.asar\src\text-editor.js:763:19)
    at TextEditor.module.exports.TextEditor.insertText (C:\Users\tintoy\AppData\Local\atom\app-1.2.4\resources\app.asar\src\text-editor.js:729:19)
    at TextEditorComponent.module.exports.TextEditorComponent.onTextInput (C:\Users\tintoy\AppData\Local\atom\app-1.2.4\resources\app.asar\src\text-editor-component.js:452:35)
    at HTMLDivElement.<anonymous> (C:\Users\tintoy\AppData\Local\atom\app-1.2.4\resources\app.asar\src\text-editor-component.js:3:61)

Commands

     -3:04.2.0 editor:select-to-beginning-of-word (atom-text-editor.editor.is-focused)
     -3:04.0 core:delete (atom-text-editor.editor.is-focused)
  2x -3:03.7.0 editor:move-to-end-of-word (atom-text-editor.editor.is-focused)
     -3:02.9.0 editor:move-to-beginning-of-word (atom-text-editor.editor.is-focused)
  4x -3:02.6.0 core:move-left (atom-text-editor.editor.is-focused)
     -3:01.7.0 core:move-right (atom-text-editor.editor.is-focused)
  3x -3:00.4.0 core:backspace (atom-text-editor.editor.is-focused)
  6x -2:58.9.0 editor:move-to-end-of-word (atom-text-editor.editor.is-focused)
  2x -2:57.8.0 core:move-right (atom-text-editor.editor.is-focused)
  9x -2:56.8.0 core:backspace (atom-text-editor.editor.is-focused)
  2x -2:45.1.0 core:select-right (atom-text-editor.editor.is-focused)
     -2:43 core:delete (atom-text-editor.editor.is-focused)
     -2:37.8.0 core:move-to-bottom (atom-text-editor.editor.is-focused)
     -2:37 core:save (atom-text-editor.editor.is-focused)
     -1:39.3.0 settings-view:check-for-package-updates (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)
     -0:07.7.0 advanced-open-file:toggle (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)

Config

{
  "core": {}
}

Installed Packages

# User
.bin, vundefined
advanced-open-file, v0.13.0
api-workbench, v0.8.6
atom-beautify, v0.28.19
atom-yeoman, v0.3.15
color-picker, v2.0.13
json-schema, v0.1.15
language-powershell, v2.1.0
linter, v1.11.3
minimap, v4.16.2
omnisharp-atom, v0.25.10
pigments, v0.19.1

# Dev
No dev packages
Osmose commented 8 years ago

Thanks for the report!

That is really weird; the only place where we call statSync (outside of the tests) we catch all errors and return null. What's supposed to happen is that you just wouldn't see Config.msi in the file listing at all.

I'll see what I can do about replicating this locally.

Osmose commented 8 years ago

I can't replicate this locally (not a surprise, I'm on OSX). I still also can't figure out why this would happen; the line numbers don't match up with what's in the repo and we catch errors in the one place we call statSync.

If you're still reliably getting this error, could you post a gist of the contents of the models.js file listed in the stack trace?

Osmose commented 8 years ago

Closing due to lack of a response. If anyone else can replicate this and provide more details, please reopen!