05-18-2024, 09:06 AM
(05-18-2024, 06:17 AM)SMcNeill Wrote: ....
We simply use the _ReadFile$ function to read the file into any given string, and let the function handle existence checks, sizing, opening handles, closing handles, and all that good stuff.
....
It will NOT do any existence checks !!
It also throws the usual "File not found" error. However, you may continue from that error and the function will not further complain about it, but simply returning an empty string.
Now as a file may exist, but still being empty, you could also regularly get back an empty string.
The only way to clarify why the result was empty is a _FILEEXIST call. And it's still the best to do this before calling _READFILE to avoid such "File not found" errors in the first place.
GuiTools, Blankers & other Projects:
https://qb64phoenix.com/forum/forumdisplay.php?fid=32
Libraries & useful Functions:
https://qb64phoenix.com/forum/forumdisplay.php?fid=23
https://qb64phoenix.com/forum/forumdisplay.php?fid=32
Libraries & useful Functions:
https://qb64phoenix.com/forum/forumdisplay.php?fid=23