Port to Java - #873
Open
davidgiven wants to merge 300 commits into
Open
Conversation
…diskWrite) - FatFs.read/write now take ByteBuffer and copy at absolute offsets without touching position/limit; byte[] overloads kept for backward compat via ByteBuffer.wrap - DiskIo adds default ByteBuffer overloads that delegate to byte[] impl via hasArray-aware copy, preserving position/limit - No changes to java/ or javatests/ (top-level) and no changes to third_party/javatests/
…ileSystemImpl uses FatFs) - Bytes.bytesFromByteBuffer now uses duplicate to avoid advancing position - FatFileSystemImpl migrated from de.waldheinz to org.elm_chan.ff.FatFs with DiskIo adapter preserving ByteBuffer position/limit - BUILD.bazel depends on //third_party/java/org/elm_chan/ff - FileSystemImpl and test expectations updated for new mkfs layout (OEM MSDOS5.0, NO NAME, correct sector locations)
- FatFs.getLabel(String path, String[] label, long[] vsn) mirrors ff.c f_getlabel (mount_volume, dir_sdi, dir_read(DIR_READ_LABEL), 11-byte AM_VOL extraction with trailing-space truncation, move_window(volbase) + ld_32 for VSN; exFAT branch pruned with comment, matching baked-in FF_FS_EXFAT=0) - FatFileSystemImpl.getTime() now uses LocalDateTime.now() (year-1980, mon, day, hour, min, sec/2 packed as FAT date/time) instead of fixed 2025-01-01 - Fix broken getFilesystemMetadata (was checkResult(lseek( ... ) syntax error) to correctly call getfree and build TOTAL_BLOCKS/USED_BLOCKS/BLOCK_SIZE)
- FatFs.setLabel(String label) mirrors ff.c f_setlabel (mount_volume with drive prefix via get_ldnumber, dirvn[11] creation with DBCS handling via dbc_1st/dbc_2nd, IsLower uppercasing, badchr check for FAT, DDEM check, trailing-space snip, Dir dj open root, dir_sdi + dir_read(DIR_READ_LABEL) to find existing AM_VOL entry, update via memcpy or DDEM removal, or dir_alloc + AM_VOL creation + sync_fs; exFAT branch pruned) - FatFileSystemImpl.create now calls setLabel(volumeName) after mkfs to persist volume label (was previously ignored, causing getFilesystemMetadata to return empty volume_name) - Fix getFilesystemMetadata to include volume_name via getLabel
- putFilesystemMetadata with valid label, replacement, empty removal - Invalid keys (empty, wrong key, mixed) throws IllegalArgumentException - Persists after flush (new FatFileSystemImpl sees updated label) - Invalid label with bad char throws InvalidPathException - Fix create() to call setLabel(volumeName) after mkfs so getFilesystemMetadata correctly reflects volume_name used at creation
dependent (Windows uses \ as a directory separator...). So implement our own simple version and use that instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.