File permissions in global inbox

SYNOPSIS: When a file is not owned yet by the user (e.g. a pdf from the web, handed from Safari or other browsers to Preview), dragging the single-thumbnail representation of the file in the Preview Side or the icon in the window bar onto DT in the Dock will result in “read-only” permissions, which will cause inconveniences when moving files within DT or otherwise updating it; if such a “read-only” file is synced to DTTG and annotated on iOS, the updates will not sync back to the Mac, leading potentially to severe losses (because the back-sync fails silently). See
for the DTTG sync issue, and
for getting pdfs and other files conveniently into DT.

Below are more details, unfortunately in a somewhat incoherent manner, as I edited this post as I figured things out.

When I import files by dragging them onto the DT icon in the dock, occasionally (see update below) the file in DT will have wrong permissions, i.e. “read only” for the user. This will have consequences when I want to move these files into their final destinations inside DT. The moment I try to drag them, the password panel pops up, asking for authentication. Initially I located the files in the Finder and used the Info panel to adjust the permissions. But eventually, this became too annoying.

Assuming that I have no executables stored, all my files in the inbox should have read and write permission for me, and read-only for everyone else. Consulting StackExchange, I used the command

find ./ -type f -exec chmod 644 {} ;

in the Terminal while being in the Global Inbox’s “Files.noindex” directory. This does the trick.

However, executing sweeping commands inside the database directories is generally not a good idea. Is there a better way of doing this? I could not find an entry in this forum discussing this problem.

Update: I believe I figured out why/when the files have this permission issue. If I download a pdf from the web, I use two methods to import the files into DT:

(1) The pdf is displayed inside Safari and I use the clipping extension for DT: then the permission seems fine (and as a side benefit, DT stores the URL of the pdf)

(2) I open the pdf in Preview to inspect it more carefully (I vastly prefer navigating pdfs in Preview, rather then the browser viewer). If I would like to keep it, I collapse the thumbnails on the left of Preview into a single one and drag that to the DT icon in the Dock (or if I only want a specific range of pages from the original pdf, I select those thumbnails and drag them onto DT). In this case, the permissions seem to be wrong. So it appears to be the export from Preview’s temp file that causes this.

2nd update: I looked some more into this. The “read-only” permission only seems to happen when the pdf is not saved yet to a folder in your user directory. If you take an existing pdf from within your user directory, you can drag the “single-thumbnail” Preview representation of this file onto the DT icon, and the permission will be OK. Pdfs that are handed to Preview directly from Safari (and most likely numerous other sources) cause this problem, presumably because they reside in some tmp location outside of the user directory, hence don’t have the right permissions to begin with.

To make things more confusing, if you only drag a single page thumbnail from a multi-page pdf, it does not seem to matter, the permissions appear to be correct in any scenario.

UPSHOT: best to avoid the dragging of the “single-thumbnail” for import into DT. Either use the Safari clipping extension or, once handed from Safari to Preview, use “save as” to a watched folder that imports automatically to DT. For details, see the bottom of this post:

IMPORTANT: While this seems just a minor nuisance, this actually has some rather big ramifications for the use of DevonThinkToGo. I will post a topic in the DTTG section and link to it later on here:

Thanks for the bug report, the next maintenance release will fix the POSIX permissions if possible/necessary while importing temporary files.