Gatekeeper preventing me from opening data files in a text editor

I have a large database of text files (.dat), downloaded from a repository I trust, that I periodically have to view or edit in a text editor (usually BBEdit but same issue exists with TextEdit). I never had an issue before today, but it seems that Gatekeeper has become more agressive about these data files and prevents me from opening them unless I go into Security settings and hit "Open Anyway". This is quite a nuisance because it's happening on thousands of files and doesn't remember my previous overrides (every time I edit a file I have to go manually override.


If I have BBEdit open, I can navigate to the file within the editor and open it that way. I also can right click on one of the files and go down to the Services menu and select "Open file in BBEdit"). But what I'm really looking for is a way to mass designate these downloaded files as safe in a way the OS will remember. Can this be done?



Mac Studio, macOS 15.4

Posted on Apr 24, 2025 8:50 AM

Reply
Question marked as Top-ranking reply

Posted on Apr 25, 2025 7:37 AM

For the benefit of anyone else having this problem, I was able to get rid of the Gatekeeper quarantine on these data files by opening a terminal window in the directory at issue and typing:


xattr -d com.apple.quarantine *.dat


Terminal threw up an error on .dat files that were *not* quarantined (most were but a few were not). After that, I could open these files in my text editor of choice by double clicking on them. As an aside, these files reside in my iCloud Drive and changing the quarantine flag doesn't propagate to my other computer via iCloud syncing. I had to run this command on both of my computers.


James

8 replies
Question marked as Top-ranking reply

Apr 25, 2025 7:37 AM in response to canecaster

For the benefit of anyone else having this problem, I was able to get rid of the Gatekeeper quarantine on these data files by opening a terminal window in the directory at issue and typing:


xattr -d com.apple.quarantine *.dat


Terminal threw up an error on .dat files that were *not* quarantined (most were but a few were not). After that, I could open these files in my text editor of choice by double clicking on them. As an aside, these files reside in my iCloud Drive and changing the quarantine flag doesn't propagate to my other computer via iCloud syncing. I had to run this command on both of my computers.


James

Apr 24, 2025 10:48 AM in response to canecaster

canecaster wrote:

I have a large database of text files (.dat), downloaded from a repository I trust, that I periodically have to view or edit in a text editor (usually BBEdit but same issue exists with TextEdit). I never had an issue before today, but it seems that Gatekeeper has become more agressive about these data files and prevents me from opening them unless I go into Security settings and hit "Open Anyway". This is quite a nuisance because it's happening on thousands of files and doesn't remember my previous overrides (every time I edit a file I have to go manually override.

If I have BBEdit open, I can navigate to the file within the editor and open it that way. I also can right click on one of the files and go down to the Services menu and select "Open file in BBEdit"). But what I'm really looking for is a way to mass designate these downloaded files as safe in a way the OS will remember. Can this be done?



. dat files from where, associated with what application...(?)


I would use what works. Nothing wrong with using BBedit.


On a selected file and change the default—> Command i opens the information pane. Make a change here: "Change All"


Apr 24, 2025 11:11 AM in response to canecaster

The data files are from National Weather Service databases, data that I've used without a problem for decades as part of my work. The .dat file extension is already associated with BBEdit - that's not the issue. The issue is that Gatekeeper thinks these files are potentially dangerous and won't open BBEdit when I double click on one of the files. I can override Gatekeeper on an individual use basis but that's a pain given the frequency with which I need to open these files.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Gatekeeper preventing me from opening data files in a text editor

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