nc_program_manager/Cnc/Mazak/FtpEntry.cs
dtrentin 89487256d7 fix(mazak): harden FTP list parsing + surface root-list failure
- FtpListParser: tolerant DOS/IIS regex (optional AM/PM, 2-or-4-digit
  year, 1-or-2-digit hour) for 24h/locale-dependent Mazak servers;
  NLST fallback now only accepts single-token lines (multi-token
  garbage/header -> skip) to avoid whole-line-as-filename.
- MazakMachine.BuildTreeAsync: root-level LIST failure now propagates
  -> Fail (no more silent exit 0 on a diagnostic probe). Children keep
  best-effort inline "errore lista" swallow. Depth semantics preserved.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-18 15:14:57 +02:00

24 lines
999 B
C#

namespace NcProgramManager.Cnc.Mazak
{
/// <summary>Single entry of an FTP directory listing (file or directory).</summary>
public sealed class FtpEntry
{
/// <summary>Entry name (no path).</summary>
public string Name { get; set; }
/// <summary>Full FTP path of the entry (parent dir + name).</summary>
public string FullPath { get; set; }
/// <summary>True if the entry is a directory.</summary>
public bool IsDirectory { get; set; }
/// <summary>File size in bytes; -1 when unknown (directories).</summary>
public long Size { get; set; } = -1;
/// <summary>Raw LIST line as returned by the server (diagnostics).</summary>
public string Raw { get; set; }
public override string ToString()
{
return IsDirectory
? string.Format("[DIR] {0}", Name)
: string.Format(" {0} ({1} B)", Name, Size >= 0 ? Size.ToString() : "?");
}
}
}