Skip to content

Port to Java - #873

Open
davidgiven wants to merge 300 commits into
masterfrom
java
Open

Port to Java#873
davidgiven wants to merge 300 commits into
masterfrom
java

Conversation

@davidgiven

Copy link
Copy Markdown
Owner

No description provided.

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant