Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Error "this file cannot be opened because you do not have permission to view it. To view or change permissions...

Hello

A strange error has come up which I've never come across before so I would like help with this issue please. I've also googled for solutions but haven't come across one yet that worked. Apparently its a mac issue?


So the issue is this. I was organising folders/photos/videos (all that belong to me and I'm the admin) when I get the above error. "this file cannot be opened because you do not have permission to view it. To view or change permissions, select the item in the Finder and choose file >"get info"


Strangely, I could be working fine on the files, with no issues, then suddenly I get the error. I can't look at it or do anything with it. I have no idea why or how this is happening. I go into the "get info" dialogue and look into the permissions part of it, and all has read and write enabled. Even if I change them to "read only" the error still persists. I have thousands of files, so imagine how time consuming it is to change the permissions on each one if the permissions relate to the problem.

Also there is no "ignore ownership" option on the external hard drive.

I would have understood this, if I was using someone's folder/images etc, but not with my own ones.


The errors would happen while working on an external hard- drive not on the mac itself. The external hard drive is mac compatible. Never had a problem with the external hard drive til now. I found a temporary solution to eject the external hard drive and then plug it back. The files will work again, but it won't last long though before I get the error again.



I can only think it has to do with permissions because I've been changing valuable files permissions' to read only and locking it so that the files dont get over-written or deleted. Can I not do that? I cannot pinpoint one file that might have caused the error.


Im still googling solutions right now but would like some explanation why I get the error so that I could see how the error could occur and if you have the solution that would be great too.


Thanks!

Claire


MacBook Air

Posted on May 4, 2020 9:33 AM

Reply
Question marked as Best reply

Posted on May 5, 2020 6:59 AM

Rather than manual permissions changes—which is seemingly what caused this—I’d look to use the following:


Resolve issues caused by changing the permissions of items in your home folder - Apple Support


Permissions are fairly gnarly when configured correctly and as macOS expects, and wrong permissions can hose access in unexpected ways, whether it’s in the file, or on the directory.


I’ve corrupted systems using -r recursion and errant commands. Syntax like /Volumes/ExternalHD/myFiles/ shown works, but a path like /Volumes/External HD/myFiles/ (note the space) might not have the intended effect. Best case, it fails. Worst, it clobbers something unexpected.) i’d encourage double-quoting target paths, if the spec might (will?) contain a character needing an escape. (Experienced users know this lesson, and inexperienced and incautious users unfortunately learn about this. I didn’t do much damage, when I learned about this. Thankfully. I’ve seen some gonzo corruptions from this, though.) Use “/Volumes/External HD/myFiles/“ — and with vertical double quotes, not the angled quotes the forum software will here show.

Similar questions

8 replies
Question marked as Best reply

May 5, 2020 6:59 AM in response to rcprado

Rather than manual permissions changes—which is seemingly what caused this—I’d look to use the following:


Resolve issues caused by changing the permissions of items in your home folder - Apple Support


Permissions are fairly gnarly when configured correctly and as macOS expects, and wrong permissions can hose access in unexpected ways, whether it’s in the file, or on the directory.


I’ve corrupted systems using -r recursion and errant commands. Syntax like /Volumes/ExternalHD/myFiles/ shown works, but a path like /Volumes/External HD/myFiles/ (note the space) might not have the intended effect. Best case, it fails. Worst, it clobbers something unexpected.) i’d encourage double-quoting target paths, if the spec might (will?) contain a character needing an escape. (Experienced users know this lesson, and inexperienced and incautious users unfortunately learn about this. I didn’t do much damage, when I learned about this. Thankfully. I’ve seen some gonzo corruptions from this, though.) Use “/Volumes/External HD/myFiles/“ — and with vertical double quotes, not the angled quotes the forum software will here show.

May 5, 2020 7:19 AM in response to clairemissy

Along the lines of what MrHoffman wrote, try dragging one of the files you are unable to read from the external hard disk into your Home folder or one of its subdirectories. Desktop for example. When doing that hold an option key to make sure you are creating a copy and not an alias. You can even eject the external hard disk drive to make doubly sure.


Attempt to open that file—the one on your Desktop, and reply with your results.


If you are unable to open that file, then Resolve issues caused by changing the permissions of items in your home folder - Apple Support really ought to fix it. That Support document's applicability is limited to one's Home folder and its contents, and probably won't help if a file resides elsewhere (such as an external disk). For that, rcprado's instructions should work, but manipulating copies within your Home folder is a more conservative approach since it leaves the external hard disk's contents untouched.

May 24, 2020 2:45 PM in response to terrylee5

terrylee5 wrote:

I get the same error. after rebooting MacBook access is granted again. later the same issue starts all over again. Why?


If you haven’t been altering your system protections on these files and directories, your issue probably isn’t related to this one, and it would be helpful to avoid confusion to please start your own thread.


Please download and run and post the output of EtreCheck in that new thread. Open a new reply, press the button that looks like a printed page to get a text input box big enough to paste the hardware and software configuration report here. Please also indicate the path to these files, if not a directory or subdirectory under /Users somewhere. Under your login directory or subdirectory, or a location somewhere else in the file system.


Usual suspects here are add-in apps; add-on cleaners, add-on anti-malware, add-on anti-virus.


If you don’t have add-ins and you have been making changes, please post the EtreCheck (which includes details such as macOS version), please indicate where these problematic files are located if not under /Users in a directory or subdirectory somewhere, and please stop making these protection changes, and please run the protection-reset mechanism mentioned earlier:


Resolve issues caused by changing the permissions of items in your home folder - Apple Support


May 4, 2020 8:14 PM in response to clairemissy

I can only think it has to do with permissions because I've been changing valuable files permissions' to read only and locking it so that the files dont get over-written or deleted. Can I not do that?


You can certainly do it, and therein lies the problem. If you do it wrong you can lock yourself out of fixing it. I've managed to mess up Permissions in a horrendous manner that Apple insisted was impossible. Having done it anyway, it proved just as impossible to fix. The solution required erasing the affected Mac.


Whatever you did, undo it, assuming you can. Change those file permissions to read / write, and "apply to enclosed items" if appropriate. It sounds like you did that to files on an external hard disk drive, so at least that didn't affect your User Account. If it did you might be facing the same fate I encountered.


To lock files so you don't inadvertently delete them, do the latter part of your quote above: merely set the "locked" bit in Get Info. Of course that's easily bypassed, but that's by design. It will prevent inadvertently overwriting or deleting something by presenting a dialog box.

May 4, 2020 8:59 PM in response to clairemissy

In addition to the above: your defense against errant deletions, overwrites, corruptions, and other data misadventures... is backups; consistent, scheduled, robust backups.


If you’re working with source code or similar, an additional defense is a distributed source code control system, and frequent, routine, rote, source code check-ins.

May 4, 2020 9:39 PM in response to clairemissy

You can ONLY fix this using terminal


and it is easy, dont worry.


First, keep in mind that there is 2 different settings for that (but the GUI confuses the user a lot)


1) Permissions: read, write

2) Ownership: user, groups


I am pretty sure the problem is about ownership, but this is not explict on the MacOS finder GUI permisssions and it messes this with users... and when we try to fix one, we damage the other


But using terminal this can easily be fixed/corrected


(PS: about "lock": its another flag, which protect the files from being changed [either permissions, or ownership])


For this to work, files must be Unlocked



we are going to to this on terminal too.


Here is the recipe:


For me to help you, i am going to create a fake/fiction similar scenario for explanations purpose:


Lets suppose/consider that the files and subdirectories that you want to fix access are on /Volumes/ExternalHD/myFiles


Open Terminal:



1) once there, lets remove the "lock" flag (if any was set) from there to the most deep directory file inside there (recursively)


type:

sudo chflags -R nouchg /Volumes/ExternalHD/myFiles/


The command above will remove the "lock" flags from all files inside the current diretory and recursively to all files and directories under it


On this example, this means everything inside:

/Volumes/ExternalHD/myFiles


will have the "lock" flags removed



After it finishes (will take about 5 to 60 or more seconds depending on how many files may be inside there.. just wait it finishes)



2) Now you have to take ownership of that files.

This is how, on terminal, type:



sudo chown -R myusername:staff /Volumes/ExternalHD/myFiles/


(where "myusername" is your MacOS Unix username. So change it to the corresponding login username of your user, as shown under /Users/ folder)


If needed, you can check/verify what your Unix username is, by typing at the terminal this command:

whoami


It is done.

now you can use Finder as always to move, copy, delete or organize the files inside that directory,

without any other problem









May 5, 2020 9:05 AM in response to John Galt

FWIW and if you’re not entirely comfortable with protections and ownerships, use a separate and purpose-created login. Using -r over there (and while still within your ~ home directory) can or will trash (other) macOS per-user directories and files, but that won’t harm your login.


I really don’t like mixing sudo and -r switches around any data that I care about, and I know how it works.


A separate disk (akin to rdprado) can also limit the sudo with -r damage, depending on what happened. And here, I’d suspect the involvement of ownership and protection on the parent directory for the file(s) in question. If y’all want us to look at that, post the ls -aled@ of the directory, and the ls -ale@ of the file(s), as a start.

Error "this file cannot be opened because you do not have permission to view it. To view or change permissions...

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.