Ediff error -- Permission denied (Win8)

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

Ediff error -- Permission denied (Win8)

Yeşim Erke-Magent
It has been years I used Emacs so when I needed to compare 2 text files (they are VBA macros, but I saved them with .txt extension.  I installed emacs (version 24.3.1) and used "Compare (Ediff)" under "Tools" menu.  Then selected "Two files" and I receive

"Searching for program: permission denied, diff"

I then open the files and tried to compare 2 buffers, but it didn't make any difference.

I have 64-bit Win8 on my PC and emacs' directory is under Users directory, not Program Files. Could this be a problem?  

BTW, I also installed GNU grep, but couldn't manage to run it through command line.  I then tried using grep under Tools of emacs and it didn't work either.

I wish I had Unix running on my machine!

I will appreciate any suggestions.
Reply | Threaded
Open this post in threaded view
|

Re: Ediff error -- Permission denied (Win8)

Óscar Fuentes
Yeşim Erke-Magent <[hidden email]> writes:

> It has been years I used Emacs so when I needed to compare 2 text
> files (they are VBA macros, but I saved them with .txt extension. I
> installed emacs (version 24.3.1) and used "Compare (Ediff)" under
> "Tools" menu. Then selected "Two files" and I receive
>
> "Searching for program: permission denied, diff"
>
> I then open the files and tried to compare 2 buffers, but it didn't make any difference.

Do you have `diff' installed?

> I have 64-bit Win8 on my PC and emacs' directory is under Users
> directory, not Program Files. Could this be a problem?

No.

> BTW, I also installed GNU grep, but couldn't manage to run it through
> command line. I then tried using grep under Tools of emacs and it
> didn't work either.

Is `grep' on a directory listed on the PATH environment variable? How do
you obtained and installed `grep'? Same for `diff'.

Please note that under Windows you either install the executables on a
directory already listed on PATH or (better) you add to PATH the
directory where you installed the executable (when you wish to execute
that executables from other executables.)

You can set PATH from the OS Control Panel or from your .emacs. See the
documentation for `setenv' function and for `exec-path' variable.

Also, Emacs has variables for finding certain programs on user-specified
places or with special names. For grep, there is the variable
`grep-program'.


Reply | Threaded
Open this post in threaded view
|

Re: Ediff error -- Permission denied (Win8)

Stefan Monnier
In reply to this post by Yeşim Erke-Magent
> I wish I had Unix running on my machine!

Do you need help with that?


        Stefan


Reply | Threaded
Open this post in threaded view
|

Re: Ediff error -- Permission denied (Win8)

Rusi
In reply to this post by Yeşim Erke-Magent
On Friday, August 2, 2013 5:09:16 AM UTC+5:30, Stefan Monnier wrote:
> > I wish I had Unix running on my machine!
>
> Do you need help with that?

Since this seems to be such a FAQ, attempting to say something.  Hopefully more windows-aware folks will amend.

Many people using windows find need for unix-ish facilities/features/feel.

Setting up native windows emacs is a first (but not last!) step.
cygwin is considered a full-featured but somewhat heavyweight answer to this need
mingw is a somewhat lighter solution.

Some comparison here http://stackoverflow.com/questions/771756/what-is-the-difference-between-cygwin-and-mingw

You can also set up diff/grep etc alone.
[I believe Eli has posted the link a few days back...]

Other solutions:
Win+Linux side-by-side: Make your system multibootable with grub.
This is an old solution. In my most recent bundled-with-win-8 laptop, copying files from ubuntu and windows is not working as it used to.  Seems to be a uefi/gpt problem.

Windows-inside-linux: wubi can be installed as a normal windows program inside windows and was quite popular but again seems to be suffering gpt/uefi related problems.

Linux-in-VM-in-windows: I know some friends who swear by VMware. No experience myself.

Wine: windows emulator inside linux. Will run many (not all!) windows programs on a vanilla gnu/linux
Reply | Threaded
Open this post in threaded view
|

Re: Ediff error -- Permission denied (Win8)

Eli Zaretskii
In reply to this post by Yeşim Erke-Magent
> Date: Thu, 1 Aug 2013 13:30:24 -0700 (PDT)
> From: Yeşim Erke-Magent <[hidden email]>
>
> It has been years I used Emacs so when I needed to compare 2 text files (they are VBA macros, but I saved them with .txt extension.  I installed emacs (version 24.3.1) and used "Compare (Ediff)" under "Tools" menu.  Then selected "Two files" and I receive
>
> "Searching for program: permission denied, diff"
>
> I then open the files and tried to compare 2 buffers, but it didn't make any difference.

Please tell what do the following 2 commands produce in Emacs:

  M-: (executable-find "diff") RET
  M-: (executable-find "grep") RET



Reply | Threaded
Open this post in threaded view
|

Re: Ediff error -- Permission denied (Win8)

Yeşim Erke-Magent
In reply to this post by Yeşim Erke-Magent
On Thursday, August 1, 2013 5:38:13 PM UTC-4, Óscar Fuentes wrote:

> Yeşim Erke-Magent <[hidden email]> writes:
>
>
>
> > It has been years I used Emacs so when I needed to compare 2 text
>
> > files (they are VBA macros, but I saved them with .txt extension. I
>
> > installed emacs (version 24.3.1) and used "Compare (Ediff)" under
>
> > "Tools" menu. Then selected "Two files" and I receive
>
> >
>
> > "Searching for program: permission denied, diff"
>
> >
>
> > I then open the files and tried to compare 2 buffers, but it didn't make any difference.
>
>
>
> Do you have `diff' installed?
>
>
>
> > I have 64-bit Win8 on my PC and emacs' directory is under Users
>
> > directory, not Program Files. Could this be a problem?
>
>
>
> No.
>
>
>
> > BTW, I also installed GNU grep, but couldn't manage to run it through
>
> > command line. I then tried using grep under Tools of emacs and it
>
> > didn't work either.
>
>
>
> Is `grep' on a directory listed on the PATH environment variable? How do
>
> you obtained and installed `grep'? Same for `diff'.
>
>
>
> Please note that under Windows you either install the executables on a
>
> directory already listed on PATH or (better) you add to PATH the
>
> directory where you installed the executable (when you wish to execute
>
> that executables from other executables.)
>
>
>
> You can set PATH from the OS Control Panel or from your .emacs. See the
>
> documentation for `setenv' function and for `exec-path' variable.
>
>
>
> Also, Emacs has variables for finding certain programs on user-specified
>
> places or with special names. For grep, there is the variable
>
> `grep-program'.

Ediff already came with GNU Emacs (under the Tools menu).  Like emacs, I downloaded GNU Grep.  Also, I installed cygwin.  I added the new directories in PATH ( I found it through)

Control Panel -> System and Security -> System -> Advanced System Settings (pops up System Properties window) -> Advanced -> Environment Variables

After installing cygwin I tried Ediff, I got a new warning

cygwin warning:
  MS-DOS style path detected: d:\Temp\Macro1.txt
  Preferred POSIX equivalent is: /cygdrive/d/Temp/Macro1.txt
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames

I tried to figure out what to do, but I don't know how to set up the environment variable.
Reply | Threaded
Open this post in threaded view
|

Re: Ediff error -- Permission denied (Win8)

Yeşim Erke-Magent
In reply to this post by Yeşim Erke-Magent
On Thursday, August 1, 2013 7:39:16 PM UTC-4, Stefan Monnier wrote:

> > I wish I had Unix running on my machine!
>
>
>
> Do you need help with that?
>
>
>
>
>
>         Stefan

Stefan, thanks for your offer, but I guess I will pass having Unix on our PC for the moment
Reply | Threaded
Open this post in threaded view
|

Re: Ediff error -- Permission denied (Win8)

Yeşim Erke-Magent
In reply to this post by Rusi
On Friday, August 2, 2013 12:44:24 AM UTC-4, Rustom Mody wrote:

> On Friday, August 2, 2013 5:09:16 AM UTC+5:30, Stefan Monnier wrote:
>
> > > I wish I had Unix running on my machine!
>
> >
>
> > Do you need help with that?
>
>
>
> Since this seems to be such a FAQ, attempting to say something.  Hopefully more windows-aware folks will amend.
>
>
>
> Many people using windows find need for unix-ish facilities/features/feel.
>
>
>
> Setting up native windows emacs is a first (but not last!) step.
>
> cygwin is considered a full-featured but somewhat heavyweight answer to this need
>
> mingw is a somewhat lighter solution.
>
>
>
> Some comparison here http://stackoverflow.com/questions/771756/what-is-the-difference-between-cygwin-and-mingw
>
>
>
> You can also set up diff/grep etc alone.
>
> [I believe Eli has posted the link a few days back...]
>
>
>
> Other solutions:
>
> Win+Linux side-by-side: Make your system multibootable with grub.
>
> This is an old solution. In my most recent bundled-with-win-8 laptop, copying files from ubuntu and windows is not working as it used to.  Seems to be a uefi/gpt problem.
>
>
>
> Windows-inside-linux: wubi can be installed as a normal windows program inside windows and was quite popular but again seems to be suffering gpt/uefi related problems.
>
>
>
> Linux-in-VM-in-windows: I know some friends who swear by VMware. No experience myself.
>
>
>
> Wine: windows emulator inside linux. Will run many (not all!) windows programs on a vanilla gnu/linux

I installed cygwin after receiving a reply to my question.  I added it to the Environment Variable, PATH (please see my previous comment) but cannot still make it work.  I guess the major problem is I can hardly remember Unix commands as well as Emacs as it has been over a decade I used them.
Reply | Threaded
Open this post in threaded view
|

Re: Ediff error -- Permission denied (Win8)

Yeşim Erke-Magent
In reply to this post by Yeşim Erke-Magent
Hi Eli,

You may have seen from my above posting that I haven't used Emacs for a loooong while, but here is the info you wanted


>
>   M-: (executable-find "diff") RET    --> d:/cgywin64/bin/diff.exe
>
>   M-: (executable-find "grep") RET    --> d:/cgywin64/bin/grep.exe
>

I added d:/cgywin64/bin in the environment variable "Path"  Does this help?

Thanks,

Yesim
Reply | Threaded
Open this post in threaded view
|

RE: Ediff error -- Permission denied (Win8)

Drew Adams
In reply to this post by Yeşim Erke-Magent
> After installing cygwin I tried Ediff, I got a new warning
> cygwin warning:
>   MS-DOS style path detected: d:\Temp\Macro1.txt
>   Preferred POSIX equivalent is: /cygdrive/d/Temp/Macro1.txt
>   CYGWIN environment variable option "nodosfilewarning" turns off this
> warning.
>   Consult the user's guide for more details about POSIX paths:
>     http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
>
> I tried to figure out what to do, but I don't know how to set up the
> environment variable.

Recent Cygwin did this nastiness to you (us).  You need to do this in
your init file or similar, to tell Cygwin "Hands off!":

 (setenv "CYGWIN" "nodosfilewarning")

I also added that to `setup-cygwin.el', in case you want to use that:
http://www.emacswiki.org/emacs-en/download/setup-cygwin.el

(Cygwin folks apparently don't like this...  See Emacs bug #14541:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14541)

HTH.

Reply | Threaded
Open this post in threaded view
|

Re: Ediff error -- Permission denied (Win8)

Eli Zaretskii
In reply to this post by Yeşim Erke-Magent
> Date: Fri, 2 Aug 2013 13:19:31 -0700 (PDT)
> From: Yeşim Erke-Magent <[hidden email]>
>
> >   M-: (executable-find "diff") RET    --> d:/cgywin64/bin/diff.exe
> >
> >   M-: (executable-find "grep") RET    --> d:/cgywin64/bin/grep.exe
> >
>
> I added d:/cgywin64/bin in the environment variable "Path"  Does this help?

Does the problem happen when you invoke Emacs as "emacs -Q"?  If it
doesn't, then something in your .emacs init file might be the culprit.

If the problem happens in "emacs -Q" as well, type

  M-x set-variable RET debug-on-error RET t RET

then invoke Ediff again.  You should get a Lisp backtrace in a
separate window.  Post that backtrace here.


Reply | Threaded
Open this post in threaded view
|

Re: Ediff error -- Permission denied (Win8)

dbbd
Hi Eli,

thanks for this post.  In fact, I have the same permission denied problem (emacs 24.3 under windows7, cygwin installed and added to windows path, diff working in DOS-terminal; problem still present if I log in as Administrator).  So I followed your advice, and here is the backtrack:

Debugger entered--Lisp error: (file-error "Searching for program" "permission denied" "diff")
  call-process("diff" nil #<buffer *ediff-diff<2>*> nil "c:\\Program Files (x86)\\GNU\\emacs-24.3\\README" "c:\\Program Files (x86)\\GNU\\emacs-24.3\\README.W32")
  apply(call-process "diff" nil #<buffer *ediff-diff<2>*> nil ("c:\\Program Files (x86)\\GNU\\emacs-24.3\\README" "c:\\Program Files (x86)\\GNU\\emacs-24.3\\README.W32"))
  ediff-exec-process("diff" #<buffer *ediff-diff<2>*> synchronize "--binary" "c:\\Program Files (x86)\\GNU\\emacs-24.3\\README" "c:\\Program Files (x86)\\GNU\\emacs-24.3\\README.W32")
  ediff-make-diff2-buffer(#<buffer *ediff-diff<2>*> "c:\\Program Files (x86)\\GNU\\emacs-24.3\\README" "c:\\Program Files (x86)\\GNU\\emacs-24.3\\README.W32")
  ediff-setup-diff-regions("c:\\Program Files (x86)\\GNU\\emacs-24.3\\README" "c:\\Program Files (x86)\\GNU\\emacs-24.3\\README.W32" nil)
  ediff-setup(#<buffer README> "c:/Program Files (x86)/GNU/emacs-24.3/README" #<buffer README.W32> "c:/Program Files (x86)/GNU/emacs-24.3/README.W32" nil nil nil ((ediff-job-name . ediff-files)) nil)
  ediff-files-internal("c:/Program Files (x86)/GNU/emacs-24.3/README" "c:/Program Files (x86)/GNU/emacs-24.3/README.W32" nil nil ediff-files)
  ediff-files("c:/Program Files (x86)/GNU/emacs-24.3/README" "c:/Program Files (x86)/GNU/emacs-24.3/README.W32")
  call-interactively(ediff-files nil nil)

Any idea why the permission could be denied coming from emacs, but diff runs fine when started directly in the DOS terminal?

Thanks a lot in advance!
Reply | Threaded
Open this post in threaded view
|

Re: Ediff error -- Permission denied (Win8)

Eli Zaretskii
> Date: Mon, 9 Mar 2015 03:39:36 -0700 (MST)
> From: dbbd <[hidden email]>
>
> thanks for this post.  In fact, I have the same permission denied problem
> (emacs 24.3 under windows7, cygwin installed and added to windows path, diff
> working in DOS-terminal; problem still present if I log in as
> Administrator).  So I followed your advice, and here is the backtrack:
>
> Debugger entered--Lisp error: (file-error "Searching for program"
> "permission denied" "diff")
>   call-process("diff" nil #<buffer *ediff-diff<2>*> nil "c:\\Program Files (x86)\\GNU\\emacs-24.3\\README" "c:\\Program Files (x86)\\GNU\\emacs-24.3\\README.W32")

Does this happen with any 2 files anywhere on your system, or just
files in that directory?

Also, please start by searching all your directories on PATH and on
exec-path for a file or directory called 'diff', with or without any
extensions, and see if you find one.

> Any idea why the permission could be denied coming from emacs, but diff runs
> fine when started directly in the DOS terminal?

Is this a Cygwin Diff or a native Windows Diff program?  If Cygwin, do
you really invoke it from cmd.exe, or do you invoke it from the Cygwin
Bash shell?

Reply | Threaded
Open this post in threaded view
|

Re: Ediff error -- Permission denied (Win8)

dbbd
Thanks for the reply, Eli.

I tried to diff files in several directories, and I got always the same permission denied error.

I have c:\cygwin\bin in my PATH, and win7's Search finds diff.exe in c:\cygwin\bin
Also, if I eval-expression (getenv "PATH") in emacs, it does contain "C:\\cygwin\\bin".

How do I get the value of exec-path?  I thought PATH was copied into it anyhow.  If I eval-expression (getenv "exec-path") it returns nil, but presumably this is not the right way of getting the value of exec-path?

The diff that works is the cygwin diff. I evoke it directly from cmd.exe, not in the cygwin bash shell.

Reply | Threaded
Open this post in threaded view
|

Re: Ediff error -- Permission denied (Win8)

Eli Zaretskii
> Date: Fri, 13 Mar 2015 04:44:34 -0700 (MST)
> From: dbbd <[hidden email]>
>
> I have c:\cygwin\bin in my PATH, and win7's Search finds diff.exe in
> c:\cygwin\bin

What about this, if typed inside Emacs:

  M-: (executable-find "diff") RET

What does it produce?

> How do I get the value of exec-path?

Like with any Emacs variable: "C-h v exec-path RET".