Implement File.Size (#2131)

* Implement file size method for already open files

* Switch from fseek/ftell to fileno/fstat size reading
This commit is contained in:
Peak
2024-04-13 18:14:52 +00:00
committed by GitHub
parent dbec0b165c
commit 5c507cc35c
4 changed files with 49 additions and 0 deletions
+5
View File
@@ -112,6 +112,11 @@ methodmap File < Handle
CloseHandle(this);
}
// Get the file size in bytes.
//
// @return File size in bytes, -1 on error.
public native int Size();
// Reads a line of text from a file.
//
// @param buffer String buffer to hold the line.