Hey !
When I write in a file with File.WriteAllLines(string1, string2[]) and the first time the string1 is long enough, and we rewrite a second time after using string1 but this time less long than before, it doesn't replace the line...

Here is the example, in french it's more longer than in english, so the line wasn't replace by the new one entirely.
I see this issue on a text editor too on Alve
I have some ideas to correct this issue, if I have the time I will correct this :)
string StringTime = Time.MonthString() + "/" + Time.DayString() + "/" + Time.YearString() + ", " + Time.HourString() + ":" + Time.MinuteString() + ":" + Time.SecondString();
string[] LoginLogFile = { UserFilePswLvl, StringTime };
string LoginLogFileNoArr = String.Join(Environment.NewLine, LoginLogFile);
File.WriteAllText(@"0:\System\Users\" + user1 + ".usr", LoginLogFileNoArr);
issue is still here with this new code
WriteAllText is the issue not WriteAllLines
@geomtech Rename the Issue !
@KingLuigi4932 thanks.
And WriteAllText use vFS so... we can say it's an issue from FAT xD
string StringTime = Time.DayString() + "/" + Time.MonthString() + "/" + Time.YearString() + ", " + Time.HourString() + ":" + Time.MinuteString() + ":" + Time.SecondString();
string[] LoginLogFile = { UserFilePswLvl, StringTime };
string[] previousTextArr = File.ReadAllLines(@"0:\System\Users\" + user + ".usr");
for (int i = 0; i < LoginLogFile.Length; i++)
{
if (previousTextArr[i] != "")
{
previousTextArr[i] = "";
}
}
string previousText = String.Join(Environment.NewLine, previousTextArr);
File.WriteAllText(@"0:\System\Users\" + user + ".usr", previousText);
Try this code :)
We already discuss of that on Gitter but I wanted to wrote it here:
It doesn't work. We have a black screen with that code.
And writing in a file take too much time. So we can't delete the file and recreate a new one, it take too much time, but it's a little solution.
We have to work on vFS.
Can you test with the last master? My FAT should have fixed this!
It is this issue yet valid?
This test is passing: https://github.com/CosmosOS/Cosmos/blob/master/Tests/Cosmos.Kernel.Tests.Fat/System.IO/FileTest.cs#L197
Good works !