ppkarwasz commented on PR #781:
URL: https://github.com/apache/commons-io/pull/781#issuecomment-3282701922

   @ecki,
   
   You’re right: the test itself shouldn’t be disabled, but only the part that 
makes assumptions which don’t hold across all macOS filesystems.
   
   After looking more closely at macOS name length limits:
   
   * `NAME_MAX` is **255 bytes** (see `getconf NAME_MAX /`). This is the 
minimum limit that POSIX guarantees every filesystem must support.
   * The `dirent` struct ([man 
dir(5)](https://man.freebsd.org/cgi/man.cgi?query=dir&sektion=5&apropos=0&manpath=macOS+15.6))
 reserves space for **1023 bytes** since Leopard. That defines the *largest 
name* the POSIX API is prepared to handle, but does not mean filesystems can 
actually allow that length.
   * **HFS+** enforces a maximum of **255 UTF-16 code units** per file name.
   * **APFS** (the default since macOS High Sierra) enforces a maximum of **255 
UTF-8 bytes** per file name.
   
   In 
https://github.com/apache/commons-io/pull/781/commits/087654e6067daaae8d9309d6351df9603596ed68
 I updated the test logic:
   
   * Always fail if creating a name **≤ 255 UTF-8 bytes** does not work.
   * For names **≥ 256 UTF-8 bytes**, only fail if *all* variants succeed. At 
least one (the pure ASCII one, where UTF-8 bytes = UTF-16 units) should fail on 
HFS+ as well.
   
   This way the test still enforces the guaranteed minimum (255 bytes), but 
tolerates differences between APFS and HFS+.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to