иСПРАВ

This commit is contained in:
tanya_nik16 2023-12-02 10:45:25 +04:00
parent ca857e1581
commit cf0e532652
2 changed files with 4 additions and 4 deletions

View File

@ -4,7 +4,7 @@ using System.IO;
using System.Text; using System.Text;
string[] files = Directory.GetFiles("../../../../var/data"); string[] files = Directory.GetFiles("/var/data");
string minFilePath = ""; string minFilePath = "";
long minFileNameLength = long.MaxValue; long minFileNameLength = long.MaxValue;
foreach (var filePath in files) foreach (var filePath in files)
@ -24,7 +24,7 @@ using (FileStream sourceStream = File.OpenRead(minFilePath))
await sourceStream.ReadAsync(buffer, 0, buffer.Length); await sourceStream.ReadAsync(buffer, 0, buffer.Length);
string text = Encoding.Default.GetString(buffer); string text = Encoding.Default.GetString(buffer);
using (FileStream targetStream = new FileStream("../../../../var/result/data.txt", FileMode.OpenOrCreate)) using (FileStream targetStream = new FileStream("/var/result/data.txt", FileMode.OpenOrCreate))
{ {
targetStream.SetLength(0); targetStream.SetLength(0);
byte[] textBytes = Encoding.Default.GetBytes(text); byte[] textBytes = Encoding.Default.GetBytes(text);

View File

@ -3,7 +3,7 @@ using System.IO;
using System.Text; using System.Text;
string[] numbers; string[] numbers;
using (FileStream fstream = File.OpenRead("../../../../var/result/data.txt")) using (FileStream fstream = File.OpenRead("/var/result/data.txt"))
{ {
byte[] buffer = new byte[fstream.Length]; byte[] buffer = new byte[fstream.Length];
await fstream.ReadAsync(buffer, 0, buffer.Length); await fstream.ReadAsync(buffer, 0, buffer.Length);
@ -24,7 +24,7 @@ foreach (var number in numbers)
int maxNumberSquared = maxNumber * maxNumber; int maxNumberSquared = maxNumber * maxNumber;
using (FileStream fstream = new FileStream("../../../../var/result/result.txt", FileMode.OpenOrCreate)) using (FileStream fstream = new FileStream("/var/result/result.txt", FileMode.OpenOrCreate))
{ {
byte[] buffer = Encoding.Default.GetBytes(maxNumberSquared.ToString()); byte[] buffer = Encoding.Default.GetBytes(maxNumberSquared.ToString());
await fstream.WriteAsync(buffer, 0, buffer.Length); await fstream.WriteAsync(buffer, 0, buffer.Length);