detect PRIVATE/M4ROOT and return the requested store count (closes #6)
A card was detected only with M4ROOT at its root, and asking for two or more stores returned one too few. A mount point now counts when its root holds a DCIM or PRIVATE/M4ROOT directory, and the count is exact. The check and the counting are split from the partition listing so tests can hand them temporary directories. Model: opus-5-5 Co-authored-by: clawbot <sneak+clawbot@sneak.cloud>
This commit was merged in pull request #10.
This commit is contained in:
1 parent
623bfe9a43
commit
445424ba3e
3 files changed
+122
-35
No files matched your search
@@ -116,8 +116,8 @@ The main types are:
|
||||
- `Image` and `Video` embed `Object`. The file extension decides which one a
|
||||
file becomes.
|
||||
|
||||
A mounted filesystem is a DCF store when its root holds a `DCIM` or `M4ROOT`
|
||||
directory. `dcf` never mounts a filesystem.
|
||||
A mounted filesystem is a DCF store when its root holds a `DCIM` or
|
||||
`PRIVATE/M4ROOT` directory. `dcf` never mounts a filesystem.
|
||||
|
||||
## TODO
|
||||
|
||||
@@ -126,13 +126,9 @@ directory. `dcf` never mounts a filesystem.
|
||||
tar of a memory card that uses them, and I'll see what I can do.
|
||||
- Parse the DCF directory and file names, rather than listing every media file
|
||||
on the filesystem.
|
||||
- Look for `PRIVATE/M4ROOT` rather than `M4ROOT` when detecting a DCF store.
|
||||
- Return exactly the number of stores asked for. `GetDCFStores` returns one too
|
||||
few when asked for two or more.
|
||||
- Read stores through `fs.FS`, with a `context.Context` to cancel a walk.
|
||||
- Return a plain slice from `GetDCFStores`, not a pointer to one.
|
||||
- Test the walk of a store and the detection of mount points. They only run
|
||||
against real mounted media today.
|
||||
- Test the walk of a store. It only runs against real mounted media today.
|
||||
- Copy files off a card, and verify each copy against its SHA256 hash.
|
||||
|
||||
## License
|
||||
|
||||
Reference in new issue
Block a user