I have written a new files-external application for the Tahoe-LAFS distributed filesystem. I have almost everything working now, but there is one issue that I have not been able to figure out.
When I navigate into the filesystem, the top level of the directory structure (the Tahoe root directory) shows up as read-only (You don’t have permission to upload or create files here). Any level of the directory structure below the root is correctly displayed as having create capabilities.
When I checked in the code with phpStorm, it looks like the read-only property is coming from a Nextcloud database entry associated with the mount point. The cache entry is being read in nextcloud/lib/private/Files/Cache/Cache.php: line 144.
Here is the code that does the database read in Cache.php:
$sql = 'SELECT
*PREFIX*filecache ’ . $where;
$result = $this->connection->executeQuery($sql, $params);
$data = $result->fetch();
The permissions column for this database entry does not have the:
const PERMISSION_CREATE = 4;
bit set. I am sure this is why the root directory shows up as non-writable.
I assume this database entry is somehow created when the filesystem is mounted. However, I have no idea why the database entry that is created for the filesystem mounts for my files_external application does not have the PERMISSION_CREATE bit set. I cannot find anything in other files_external applications where this bit is specifically set.
What am I missing in order to get the mount point of these filesystems show up as read/write?