Page MenuHomeFeedback Tracker

Unexpected behavior of FindFile() on Linux
Assigned, UrgentPublic

Description

Unexpected behavior of FindFile() on Linux with 1.24 server (not tested in experimental branch)

FindFile() when setting the flag FindFileFlags.ALL as well as FindFileFlags.DIRECTORIES finds only files, but does not find directories.
At the same time, it sets an attribute with index 4, which, as I understand it, is outside the scope of enum FileAttr where the last index is 3 with type INVALID

Details

Severity
None
Resolution
Open
Reproducibility
Always
Operating System
Linux x64
Operating System Version
6.1.0-18-amd64 Debian
Category
General
Steps To Reproduce
FindFileHandle handle = FindFile("$mission:/some/*", dir, attr, FindFileFlags.DIRECTORIES);
Print("[DEBUG] FindFileHandle dir: " + dir); // return file, not dir
Print("[DEBUG] FindFileHandle attr: " + attr); // return 4 for file

Event Timeline

WoozyMasta edited Steps To Reproduce. (Show Details)
WoozyMasta updated the task description. (Show Details)Mar 6 2024, 8:35 PM
WoozyMasta updated the task description. (Show Details)

UPD:

also does not find files if something is installed after the glob template, for example:

FindFile("$mission:/some/*.ext", dir, attr, FindFileFlags.DIRECTORIES);
FindFile("$mission:/some/*.ext", dir, attr, FindFileFlags.ALL);

won't find anything

FindFile("$mission:/some/*", dir, attr, FindFileFlags.DIRECTORIES);
FindFile("$mission:/some/*", dir, attr, FindFileFlags.ALL);

will only find files

FindFile("$mission:/some/", dir, attr, FindFileFlags.DIRECTORIES);
FindFile("$mission:/some/", dir, attr, FindFileFlags.DIRECTORIES);
FindFile("$mission:/some", dir, attr, FindFileFlags.ALL);
FindFile("$mission:/some", dir, attr, FindFileFlags.ALL);

won't find anything either

I understand that in linux everything is a file, but this seems to break the inherent logic in many mods, for example EditorLoader or Deliginator

WoozyMasta updated the task description. (Show Details)Mar 6 2024, 9:59 PM
lava76 added a subscriber: lava76.Mar 6 2024, 11:54 PM
Geez changed the task status from New to Assigned.Mar 7 2024, 11:37 AM