Ferreteria/v0.6/clade/Sys/FileSys/Aspect/Ident/native/SplFile/@notes/2026/06/04

From WoozleCodes
Jump to navigation Jump to search
2026/06/03 2026/06/04 2026/06/05

This was still marginally in use, with the following areas of functionality being defined:

  • $this->Exists() is powered by file_exists(), which should have been out-of-scope.
  • $this->Size() is powered by SplFileInfo->getSize() but is now better handled by Stat (which is Venue-agnostic).
  • Provides a slightly-more-granular filespec-parsing, to fill in a couple of gaps left by parse_url() (wrapped by NodeURL which only parses down to the path-level and doesn't break out <path>, <base>, and <ext> from <path/base.ext>.
    • The <path>/<name.ext> split is now better handled by PathPiece, which eliminates the need for the following functions:
      • SpecFull() (main value)
      • SpecPath() (from SplFileInfo->getPath())
      • SpecNameExt() (from SplFileInfo->getFilename())
    • What remains is:
      • SpecNameCore(), which extracts <base> from <base>.<ext> by removing <ext> from the end of SplFileInfo->getFilename()
      • SpecExtn(), which extracts <ext> (from SplFileInfo->getExtension())
      • SpecNameExt(), which extracts <base.ext> (from SplFileInfo->getFilename())

If these were complex operations, it might be worth keeping this clade so as not to implement them, but:

  • They are not.
  • This implementation assumes that the <ext> should only ever be the characters after the final ., and assumes that any other . are just part of the <base>. This is usually true, but in some cases (e.g. .tar.gz) it may be useful to be able to extract all <ext>s in play (e.g. for indexing).

Conclusion: I'm retiring this clade and will manually implement the <base> / <ext> split in NodeURL (which is now a conceptual wrapper and not a native wrapper).