Hopefully fixes all issues with linux based path finding
This commit is contained in:
@@ -252,14 +252,18 @@ namespace LightlessSync.Utils
|
||||
};
|
||||
|
||||
using var proc = Process.Start(psi);
|
||||
string stdout = proc?.StandardOutput.ReadToEnd().Trim() ?? "";
|
||||
proc?.WaitForExit();
|
||||
|
||||
if (int.TryParse(stdout, out int blockSize) && blockSize > 0)
|
||||
string stdout = proc?.StandardOutput.ReadToEnd().Trim() ?? "";
|
||||
string _stderr = proc?.StandardError.ReadToEnd() ?? "";
|
||||
|
||||
try { proc?.WaitForExit(); }
|
||||
catch (Exception ex) { logger?.LogTrace(ex, "stat WaitForExit failed under Wine; ignoring"); }
|
||||
|
||||
if (!(!int.TryParse(stdout, out int block) || block <= 0))
|
||||
{
|
||||
_blockSizeCache[root] = blockSize;
|
||||
logger?.LogTrace("Filesystem block size via stat for {root}: {block}", root, blockSize);
|
||||
return blockSize;
|
||||
_blockSizeCache[root] = block;
|
||||
logger?.LogTrace("Filesystem block size via stat for {root}: {block}", root, block);
|
||||
return block;
|
||||
}
|
||||
|
||||
logger?.LogTrace("stat did not return valid block size for {file}, output: {out}", fi.FullName, stdout);
|
||||
|
||||
Reference in New Issue
Block a user