Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

texastom

macrumors newbie
Original poster
Aug 21, 2015
2
0
I'm having issues writing to files and directories. I'm also new to the mac os world.

Example of the issue:
I'll create some files within the directory /users/username/dev.
When I go to edit those files within that directory or subdirectories using sublime, nano, etc., I'll be prompted with either permission denied messages or I'll have to continuously enter my user password (in the UI).
Do I have to constantly use sudo nano myfile.txt in order to edit files also? It seems the permissions.
(Note that I use both sublime, nano, etc. to modify files.)

Another (more complex issue)
I installed the laravel framework to /Applications/MAMP/htdocs/websitedir/

When I tried to view the site I couldn't see it until I entered the command: sudo chmod -R gu+w websitedir/*

Do I have to apply some type of write permissions to all of these directories?

If it's important, I'm also logging into the system with my local account and not any network accounts (though network accounts are available).
 

MacUser2525

Suspended
Mar 17, 2007
2,097
377
Canada
I'm having issues writing to files and directories. I'm also new to the mac os world.

Example of the issue:
I'll create some files within the directory /users/username/dev.
When I go to edit those files within that directory or subdirectories using sublime, nano, etc., I'll be prompted with either permission denied messages or I'll have to continuously enter my user password (in the UI).
Do I have to constantly use sudo nano myfile.txt in order to edit files also? It seems the permissions.
(Note that I use both sublime, nano, etc. to modify files.)

Another (more complex issue)
I installed the laravel framework to /Applications/MAMP/htdocs/websitedir/

When I tried to view the site I couldn't see it until I entered the command: sudo chmod -R gu+w websitedir/*

Do I have to apply some type of write permissions to all of these directories?

If it's important, I'm also logging into the system with my local account and not any network accounts (though network accounts are available).

Well no special permissions should be needed to access your files in your home directory as you mention in your first example check them directories.

Code:
MacUser2525:~$ ls -l /Users/MacUser2525/
total 96
drwxr-xr-x  4 MacUser2525  admin  136B 11 Jul 09:54 Applications/
drwxr-xr-x  60 MacUser2525  admin  2.0K  5 Aug 08:54 Bin/
drwx------+  4 MacUser2525  admin  136B 12 Aug 09:24 Desktop/
drwx------+ 51 MacUser2525  admin  1.7K 13 Aug 14:16 Documents/
drwx------+  7 MacUser2525  admin  238B  2 Jul 15:19 Downloads/
drwx------+ 74 MacUser2525  admin  2.5K 15 Aug 19:16 Library/
drwx------+  9 MacUser2525  admin  306B 29 May 21:55 Movies/
drwx------+  5 MacUser2525  admin  170B 19 Jun 15:20 Music/
drwx------+ 13 MacUser2525  admin  442B 29 May 21:50 Pictures/
drwxr-x---+  6 MacUser2525  admin  204B 26 Mar  2008 Public/
drwxr-xr-x+  8 MacUser2525  admin  272B 11 Oct  2013 Sites/

As you can see mine are all owned by me, the Sites directory you see there is where your user accessible websites are supposed to go since it is owned by me no changing of permission is required like the root owned /Applications directory you put the files in.

Code:
MacUser2525:~$ ls -l / | grep Applications
drwxrwxr-x+ 97 root  admin  3.2K 30 Jul 22:48 Applications/
 
  • Like
Reactions: texastom

texastom

macrumors newbie
Original poster
Aug 21, 2015
2
0
Well no special permissions should be needed to access your files in your home directory as you mention in your first example check them directories.

Code:
MacUser2525:~$ ls -l /Users/MacUser2525/
total 96
drwxr-xr-x  4 MacUser2525  admin  136B 11 Jul 09:54 Applications/
drwxr-xr-x  60 MacUser2525  admin  2.0K  5 Aug 08:54 Bin/
drwx------+  4 MacUser2525  admin  136B 12 Aug 09:24 Desktop/
drwx------+ 51 MacUser2525  admin  1.7K 13 Aug 14:16 Documents/
drwx------+  7 MacUser2525  admin  238B  2 Jul 15:19 Downloads/
drwx------+ 74 MacUser2525  admin  2.5K 15 Aug 19:16 Library/
drwx------+  9 MacUser2525  admin  306B 29 May 21:55 Movies/
drwx------+  5 MacUser2525  admin  170B 19 Jun 15:20 Music/
drwx------+ 13 MacUser2525  admin  442B 29 May 21:50 Pictures/
drwxr-x---+  6 MacUser2525  admin  204B 26 Mar  2008 Public/
drwxr-xr-x+  8 MacUser2525  admin  272B 11 Oct  2013 Sites/

As you can see mine are all owned by me, the Sites directory you see there is where your user accessible websites are supposed to go since it is owned by me no changing of permission is required like the root owned /Applications directory you put the files in.

Code:
MacUser2525:~$ ls -l / | grep Applications
drwxrwxr-x+ 97 root  admin  3.2K 30 Jul 22:48 Applications/

Thanks for the solution. I moved the sites from the MAMP directory to my dev/sites directory and that did the trick.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.