2026/07/28

From WoozleCodes
< 2026 | 07
Jump to navigation Jump to search
Tuesday, July 28, 2026 (#209)
Monday Tuesday Wednesday

References

Main Work

Ferreteria FileSys stuff in order to support sftp in FTM

Still fixing DBA... The Exec-Stream clades need a little reorganizing too, triggered by the fact that IO\Aspect\Connx\Stream\Exec\SSH2 needs to provide auxiliary streams (ErrorStream() and InOutStream()) and wants to quasicreate them via StreamClass::FromNative(), which I had removed because that kind of thing belongs in a Core clade.

Is there a Core clade for native streams? Well, there's Sys\InOut\Connx\Stream\File\core\Native, which is for native file-streams -- but what's the difference between the native API for file streams and non-file streams? It looks like this just uses fclose(), fread(), and fwrite(). (It apparently doesn't even use fopen() because it is passed an already-open stream-resource; that should probably be done by the caller, for consistency. Maybe.) ...so, basically, this could be a native wrapper for generic streams, not just file-streams.

Two native functions that kind of do the same thing differently:

  • fread() is lower-level, and will only return what has already been received -- good for when you have a lot of data and want to monitor progress; requires a read-check loop
    • Used in ReadAvail (formerly PullBytes)
  • stream_get_contents() is higher level, and waits until all the data requested has been returned or EoF encountered -- good for when you're expecting only a relatively small amount of data (e.g. error messages) and can wait a few milliseconds for it
    • Used in ReadUntil() (formerly ReadBytes())