class_docstr: Command channel based on a local file system.
  This is the legacy implementation before NNI v3.0.
class_docstr_tok: ["Command","channel","based","on","a","local","file","system",".","This","is","the","legacy","implementation","before","NNI","v3.0","."]
code: def __init__(self):
      self._sysdir = trial_env_vars.NNI_SYS_DIR
      if not os.path.exists(os.path.join(self._sysdir, ".nni")):
          os.makedirs(os.path.join(self._sysdir, ".nni"))
      self._metric_file = open(
          os.path.join(self._sysdir, ".nni", "metrics"), "ab"
      )
  
      self._outputdir = trial_env_vars.NNI_OUTPUT_DIR
      if not os.path.exists(self._outputdir):
          os.makedirs(self._outputdir)
  
      self._reuse_mode = trial_env_vars.REUSE_MODE
      self._nni_platform = trial_env_vars.NNI_PLATFORM
  
      self._multiphase = trial_env_vars.MULTI_PHASE
  
      self._param_index = 0
  
file_path: nni/nni/runtime/trial_command_channel/local_legacy.py
imports: from __future__ import annotations
  import os
  import sys
  import time
  import subprocess
  from typing import cast
  from typing_extensions import Literal
  from nni.common import dump, load
  from nni.typehint import TrialMetric
  from .base import TrialCommandChannel, ParameterRecord
  from ..env_vars import trial_env_vars
label_desc: Use image node_id 1 to create a new LocalLegacyTrialCommandChannel object from inherited base classes: TrialCommandChannel with example: obj = LocalLegacyTrialCommandChannel()