Skip to content

Нет поддержки ввода/вывода в файл в Windows #49

@nidropakshin2

Description

@nidropakshin2

Интерпретатор можно вызвать из командной строки так:

interpr [options] program.pr [< input.txt] [> output.txt]

Не работает для Windows. Можно исправить добавив флаги -i -o для перенаправления stdin/stdout в файлы

else if (args[pos] == "-i") 
{	
	pos += 1;
	try 
	{
		auto input = File(args[pos], "r");
		stdin = input;
	}
	catch (Exception e)
	{
		stderr.writefln("Cannot find input file \"%s\", using stdin", args[pos]);
	}
			
}
else if (args[pos] == "-o") 
{
	pos += 1;
	try 
	{
		auto output = File(args[pos], "w");
		stdout = output;
	}
	catch (Exception e)
	{
		stderr.writefln("Cannot find output file \"%s\", using stdout", args[pos]);
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions