Find the answer to your Linux question:
Results 1 to 4 of 4
I added a new user and added him to gps: sudo and admin and in his own directory when he:$ echo '<p>Hello World</p>' > directory/index.html he can't read the file ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2012
    Posts
    27

    New user in sudo & admin grps can't read own file opened in emacs.


    I added a new user and added him to gps: sudo and admin and in his own directory when he:$ echo '<p>Hello World</p>' > directory/index.html he can't read the file if he opens it with emacs w/o sudo emacs. If he opens it:$ sudo emacs index.html then he can read it, but if he just opens it:$ emacs index.html he cant read it.

    what is going on?

    thanks for help.

  2. #2
    Just Joined!
    Join Date
    May 2010
    Posts
    1

    Check directory permissions

    Without knowing any details, it sounds like a group or user permission problem. Please make sure that the directory and files have at least 750 permission.

    Quote Originally Posted by papazulu View Post
    I added a new user and added him to gps: sudo and admin and in his own directory when he:$ echo '<p>Hello World</p>' > directory/index.html he can't read the file if he opens it with emacs w/o sudo emacs. If he opens it:$ sudo emacs index.html then he can read it, but if he just opens it:$ emacs index.html he cant read it.

    what is going on?

    thanks for help.

  3. #3
    Just Joined!
    Join Date
    Jun 2012
    Posts
    27
    Oh i just noticed that for some reason when not using 'sudo' to open emacs it behaves as if I am in /home/username/.emacs.d/ directory. The '.emacs.d' directory. So after I create the file, save it and then try to open it again with just:$ emacs file.txt , it doesn't actually open the file, rather it attempts to create a new file called file.txt in the .emacs.d folder. But when I am typing out 'emacs file.txt' is actually auto-completes with tab like it is about to open the already created file but after hitting <RET> it is suddenly inside .emacs.d at a new file prompt.

    This seems like an emacs issue maybe, but then why would it work just fine when using 'sudo emacs file.txt'? And also it works fine with Gedit without using sudo.

  4. $spacer_open
    $spacer_close
  5. #4
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,653
    How are you opening emacs?
    If it's a menu item, does it set a default path?
    Does a save as work?
    "I used to be with it, then they changed what it was.
    Now what was it isn't it, and what is it is weird and scary to me.
    It'll happen to you too."

    Grandpa Simpson



    The Fifth Continent

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •