예제 #1
0
        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");
                }
            }
        }
예제 #2
0
파일: Misc.cs 프로젝트: tfischer4765/KOS
        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");
                }
            }
        }