❔ File.WriteAllText(string, string?) and similar fail to write to file

PPixel1/23/2023
Hi, im working on a Logger library and im trying different ways to implement logging to a file, but no matter what i tried (File.WriteAllText, File.WriteAllTextAsync, File.Append, FileStream.Write) they all end creating a file, but not writing to it


the function for writing text to a file is as follow
private void File_WriteText(string ToPrint)
        {
            File.WriteAllText(LogFile, ToPrint);
        }

LogFile and File_WriteText are both members of the OLog class, LogFile is a public string containing a path to the log file, by default it is log,
if i missed any information do ask for more, the end result will most likely be open source anyways

OS:: Arch Linux
.NET:: 7.0/6.0 (both have the same issue)
Pphaseshift1/23/2023
You're probably looking in the wrong place for the file. There's very little that can go wrong with WriteAllText
Ddont1/23/2023
eventually you can use sysinternal's tool to look where your program is writing
but seems overkill for this
PPixel1/23/2023
i can see the file get created it just does not have any content
AAngius1/23/2023
Run the debugger to ensure the string you're trying to write actually contains something?
PPixel1/23/2023
yeah it contains something
Ddont1/23/2023
is there an exception being annihilated?
PPixel1/23/2023
how would i check?
CCyberrex1/24/2023
what tool is that?
Ddont1/24/2023
filemon, which has been replaced by process monitor
CCyberrex1/24/2023
good to know this exists thanks
Ddont1/24/2023
only on windows tho'
CCyberrex1/24/2023
yeah ik
AAccord1/25/2023
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
PPixel1/25/2023
damnit shit's not solved
AAccord1/26/2023
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
PPixel1/29/2023
ffs it's not solved
Ddont1/29/2023
how writing a file on a local drive can take so much to debug
AAccord1/30/2023
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.