Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open in separate editor on Windows 10 #42

Open
blokeley opened this issue Jul 8, 2016 · 5 comments
Open

Cannot open in separate editor on Windows 10 #42

blokeley opened this issue Jul 8, 2016 · 5 comments

Comments

@blokeley
Copy link

blokeley commented Jul 8, 2016

To replicate:

  1. GET https://www.google.com/
  2. Select 'Open in separate editor'.

Atom error dialog:

Cannot save to tmp directory... 
{"errno":-4058, "code":ENOENT, "syscall":"open, "path":"C:\\tmp\\GET - www.google.com"}
@ddavison
Copy link
Owner

i'm unable to replicate getting this error, but i do notice that it doesn't open correctly.

upon clicking "Open in separate editor", i see that it does put the file with the appropriate contents in C:\tmp\GET - www.google.com but it doesn't open it in atom. will definitely have to take a closer look at this.

@ajelinek
Copy link

I have the same issue on Windows 7 box

@ddavison ddavison mentioned this issue Oct 5, 2016
@ddavison
Copy link
Owner

so, i did some more research, and this happens when C:\tmp\ doesn't exist to save a file in it. Two possible solutions i can see:

  1. We can have the REST client create this directory first, or...
  2. Utilize the temp npm package to save temporary files.

I think i like option 2 best because this will utilize platform specific temp locations. the temp package i believe uses %TEMP% in windows

@signothefish
Copy link

signothefish commented Nov 10, 2016

I got it working in Windows. Edit .atom\packages\rest-client\lib\rest-client-editor.coffee, line 12:

@path = process.env.TEMP + "\\#{@file_name}.json"

Just give it the extension of the payload type you expect.

@philipsimonhall
Copy link

This worked for me too, but I don't think you need to include the file extension, at least not if you're using Content-Type: application/json in the headers.

I also added .replace('?', '') to line 31 for when parameters are being passed in the URI. Not very elegant, but it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants