2022/10/28

From Woozle Writes Code
Jump to navigation Jump to search
Friday, October 28, 2022 (#301)
Thursday Friday Saturday

File Index Comparison Analysis

It looks like I need a kind of data-analysis tool for FIC's output -- because I would like to be able to find the following:

  • Files found in only one Set
  • Files with duplicates in the same Set

Both of these can be found by loading FIC's output and doing a bit of indexing, and that also seems the best way of doing it; adding that information to the output itself is nontrivial and either results in redundant information or needing to manually look up files by their hash.

Terminal Emulation

I really need a way to have multiple rewriteable status lines in CLI, and it looks like the way to do that is via ncurses, but connecting PHP with ncurses looks complicated and fragile... plus I kinda feel like it should just be implemented natively in PHP, because doing terminal escape codes is not super-complicated (I did it in frickin' FORTRAN IV) and I don't need fancy windowing stuff that ncurses does. I've tried to find the source code for ncurses, to see what the escape codes are (mainly the magic it uses to determine which terminal is being emulated), but so far no luck.

This feels like a simple problem that has somehow been made unmanageably difficult.

ANSI escape codes seem like they may offer a solution. It's probably not as universally-compatible as using some library based on Terminfo[1], as ncurses seems to be, but I can wrap it in a class-family that will make it relatively easy to add support for other terminal code-sets later.

Query: Why isn't there a universal interface for PHP to talk to arbitrary .so libraries, the way Visual Basic does with ActiveX DLLs? How do .so libraries even work?

I think the first things I need to figure out are:

  • clear the screen
  • get screen dimensions

Footnote

  1. ...which, trivia, was first written by a trans woman