Remove binary flag in file

This commit is contained in:
Alessandro Proto 2023-03-18 18:12:22 +01:00
parent 57195bcf0b
commit f782dbddb2

View file

@ -509,7 +509,7 @@ public class FileSystem : IComponent
var mode = L.OptString(2, "r"); var mode = L.OptString(2, "r");
var errorMessage = "invalid file mode"; var errorMessage = "invalid file mode";
if (mode.Length < 1 && mode.Length > 2) if (mode.Length < 1)
{ {
L.ArgumentError(2, errorMessage); L.ArgumentError(2, errorMessage);
return 0; return 0;
@ -541,20 +541,6 @@ public class FileSystem : IComponent
return 0; return 0;
} }
bool binaryMode = false;
if (mode.Length == 2)
{
if (mode[1] == 'b')
{
binaryMode = true;
}
else
{
L.ArgumentError(2, errorMessage);
return 0;
}
}
try try
{ {
var fileStream = File.Open(path, fileMode, fileAccess, FileShare.ReadWrite | FileShare.Delete); var fileStream = File.Open(path, fileMode, fileAccess, FileShare.ReadWrite | FileShare.Delete);