public override void Execute(SharedObjects shared) { string fileName = shared.Cpu.PopValue().ToString(); string expressionResult = shared.Cpu.PopValue().ToString(); if (shared.VolumeMgr != null) { Volume volume = shared.VolumeMgr.CurrentVolume; if (volume != null) { volume.AppendToFile(fileName, expressionResult); } else { throw new Exception("Volume not found"); } } }
public override void Execute(SharedObjects shared) { string fileName = PopValueAssert(shared, true).ToString(); string expressionResult = PopValueAssert(shared).ToString(); AssertArgBottomAndConsume(shared); if (shared.VolumeMgr != null) { Volume volume = shared.VolumeMgr.CurrentVolume; if (volume != null) { if (!volume.AppendToFile(fileName, expressionResult)) { throw new KOSFileException("Can't append to file: not enough space or access forbidden"); } } else { throw new KOSFileException("Volume not found"); } } }