Allow hard-links to be created
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 50/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- java
- Domain
- operating-systems
Research direction
Start with createLink in src/main/java/org/cryptomator/cryptofs/CryptoFileSystemProvider.java and link in CryptoFileSystemImpl.java, then review how the existing ciphertext paths are mapped. Verify the implementation against the Java NIO hard-link contract and confirm that creating a link through the provider succeeds for an existing file.
Written by the indexing model from the issue text.
Description
Would be great if cryptofs would also allow hard-links on disc.
I made a "proof-of-concept" implementation (see patch attached) which only adds about 10 lines of code.
diff --git a/src/main/java/org/cryptomator/cryptofs/CryptoFileSystemImpl.java b/src/main/java/org/cryptomator/cryptofs/CryptoFileSystemImpl.java
index 3c84460..0fa5077 100644
--- a/src/main/java/org/cryptomator/cryptofs/CryptoFileSystemImpl.java
+++ b/src/main/java/org/cryptomator/cryptofs/CryptoFileSystemImpl.java
@@ -403,6 +403,12 @@
throw new NoSuchFileException(cleartextSource.toString());
}
}
+
+ void link(CryptoPath cleartextLink, CryptoPath cleartextExisting) throws IOException {
+ Path ciphertextLinkFile = cryptoPathMapper.getCiphertextFilePath(cleartextLink, CiphertextFileType.FILE);
+ Path ciphertextExistingFile = cryptoPathMapper.getCiphertextFilePath(cleartextExisting, CiphertextFileType.FILE);
+ Files.createLink(ciphertextLinkFile, ciphertextExistingFile);
+ }
private void copyAttributes(Path src, Path dst) throws IOException {
Set<Class<? extends FileAttributeView>> supportedAttributeViewTypes = fileStore.supportedFileAttributeViewTypes();
diff --git a/src/main/java/org/cryptomator/cryptofs/CryptoFileSystemProvider.java b/src/main/java/org/cryptomator/cryptofs/CryptoFileSystemProvider.java
index ea9595a..3627e68 100644
--- a/src/main/java/org/cryptomator/cryptofs/CryptoFileSystemProvider.java
+++ b/src/main/java/org/cryptomator/cryptofs/CryptoFileSystemProvider.java
@@ -383,4 +383,9 @@
}
}
+ @Override
+ public void createLink(Path link, Path existing) throws IOException {
+ fileSystem(existing).link(CryptoPath.castAndAssertAbsolute(link), CryptoPath.castAndAssertAbsolute(existing));
+ }
+
}
- Dominant language
- Java
- Stars
- 110
- Forks
- 39
- Avg merge
- 1d 28m
- Merged PRs (30d)
- 4
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cryptomator/cryptofs
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
cryptomator/cryptofs#372 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
cryptomator/cryptofs#246 · 6 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
cryptomator/cryptofs#177 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
cryptomator/cryptofs#171 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
cryptomator/cryptofs#153 ·
All issues in cryptomator/cryptofs
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
wultra/powerauth-tests#980 ·
-
account bug communication lecture
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
line/centraldogma#1397 ·
Maintainers usually reply within 2 days
-
[Bug]: Fixed/recurring deposit accounts are treated as savings in ownership and listingsPossibly taken @Aana123 claimed this today. Openbug Triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
apache/fineract-consumer-facing#252 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
cryptomator/hub#515 ·