You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Implement get_filesystem_type on macOS and Linux.
This commit is contained in:
@@ -52,6 +52,8 @@ protected:
|
||||
virtual bool is_hidden(const String &p_name) override;
|
||||
virtual bool is_case_sensitive(const String &p_path) const override;
|
||||
|
||||
virtual String get_filesystem_type() const override;
|
||||
|
||||
virtual bool is_bundle(const String &p_file) const override;
|
||||
};
|
||||
|
||||
|
||||
@@ -34,11 +34,20 @@
|
||||
|
||||
#include "core/config/project_settings.h"
|
||||
|
||||
#include <sys/mount.h>
|
||||
#include <cerrno>
|
||||
|
||||
#import <AppKit/NSWorkspace.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
String DirAccessMacOS::get_filesystem_type() const {
|
||||
struct statfs fs;
|
||||
if (statfs(current_dir.utf8().get_data(), &fs) != 0) {
|
||||
return "";
|
||||
}
|
||||
return String::utf8(fs.f_fstypename).to_upper();
|
||||
}
|
||||
|
||||
String DirAccessMacOS::fix_unicode_name(const char *p_name) const {
|
||||
String fname;
|
||||
if (p_name != nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user