2021-06-27 21:25:29 +00:00
/***
Copyright ( C ) 2021 J Reece Wilson ( a / k / a " Reece " ) . All rights reserved .
File : Resources . cpp
Date : 2021 - 6 - 16
Author : Reece
* * */
2021-09-30 14:57:41 +00:00
# include <Source/RuntimeInternal.hpp>
2021-06-27 21:25:29 +00:00
# include "FS.hpp"
# include "Resources.hpp"
# if defined(AURORA_PLATFORM_LINUX)
# include <sys/types.h>
# include <pwd.h>
# include <unistd.h>
# elif defined(AURORA_PLATFORM_WIN32)
# include <ShlObj_core.h>
2021-12-24 15:44:51 +00:00
# include <accctrl.h>
# include <aclapi.h>
2021-06-27 21:25:29 +00:00
# endif
namespace Aurora : : IO : : FS
{
2021-12-24 15:44:51 +00:00
# if defined(AURORA_PLATFORM_WIN32)
2022-01-19 17:08:13 +00:00
static void Win32FixGlobalAppDataAcl ( const AuString & path ) ;
2021-12-24 15:44:51 +00:00
# endif
2022-01-18 14:26:38 +00:00
2021-06-27 21:25:29 +00:00
static AuString gHomeDirectory ;
2022-01-18 14:26:38 +00:00
static AuString gUserHomeDirectory ;
static AuString gUserWritableAppData ;
static AuString gGlobalWritableAppDirectory ;
static AuString gAdminWritableAppDirectory ;
[*/+/-] MEGA COMMIT. ~2 weeks compressed.
The intention is to quickly improve and add util apis, enhance functionality given current demands, go back to the build pipeline, finish that, publish runtime tests, and then use what we have to go back to to linux support with a more stable api.
[+] AuMakeSharedArray
[+] Technet ArgvQuote
[+] Grug subsystem (UNIX signal thread async safe ipc + telemetry flusher + log flusher.)
[+] auEndianness -> Endian swap utils
[+] AuGet<N>(...)
[*] AUE_DEFINE conversion for
ECompresionType, EAnsiColor, EHashType, EStreamError, EHexDump
[+] ConsoleMessage ByteBuffer serialization
[+] CmdLine subsystem for parsing command line arguments and simple switch/flag checks
[*] Split logger from console subsystem
[+] StartupParameters -> A part of a clean up effort under Process
[*] Refactor SysErrors header + get caller hack
[+] Atomic APIs
[+] popcnt
[+] Ring Buffer sink
[+] Added more standard errors
Catch,
Submission,
LockError,
NoAccess,
ResourceMissing,
ResourceLocked,
MalformedData,
InSandboxContext,
ParseError
[+] Added ErrorCategorySet, ErrorCategoryClear, GetStackTrace
[+] IExitSubscriber, ETriggerLevel
[*] Write bias the high performance RWLockImpl read-lock operation operation
[+] ExitHandlerAdd/ExitHandlerRemove (exit subsystem)
[*] Updated API style
Digests
[+] CpuId::CpuBitCount
[+] GetUserProgramsFolder
[+] GetPackagePath
[*] Split IStreamReader with an inl file
[*] BlobWriter/BlobReader/BlobArbitraryReader can now take shared pointers to bytebuffers. default constructor allocates a new scalable bytebuffer
[+] ICharacterProvider
[+] ICharacterProviderEx
[+] IBufferedCharacterConsumer
[+] ProviderFromSharedString
[+] ProviderFromString
[+] BufferConsumerFromProvider
[*] Parse Subsystem uses character io bufferer
[*] Rewritten NT's high perf semaphore to use userland SRW/ConVars [like mutex, based on generic semaphore]
[+] ByteBuffer::ResetReadPointer
[*] Bug fix bytebuffer base not reset on free and some scaling issues
[+] ProcessMap -> Added kSectionNameStack, kSectionNameFile, kSectionNameHeap for Section
[*] ProcessMap -> Refactor Segment to Section. I was stupid for keeping a type conflict hack API facing
[+] Added 64 *byte* fast RNG seeds
[+] File Advisorys/File Lock Awareness
[+] Added extended IAuroraThread from OS identifier caches for debug purposes
[*] Tweaked how memory is reported on Windows. Better consistency of what values mean across functions.
[*] Broke AuroraUtils/Typedefs out into a separate library
[*] Update build script
[+] Put some more effort into adding detail to the readme before rewriting it, plus, added some media
[*] Improved public API documentation
[*] Bug fix `SetConsoleCtrlHandler`
[+] Locale TimeDateToFileNameISO8601
[+] Console config stdOutShortTime
[*] Begin using internal UTF8/16 decoders when platform support isnt available (instead of stl)
[*] Bug fixes in decoders
[*] Major bug fix, AuMax
[+] RateLimiter
[+] Binary file sink
[+] Log directory sink
[*] Data header usability (more operators)
[+] AuRemoveRange
[+] AuRemove
[+] AuTryRemove
[+] AuTryRemoveRange
[+] auCastUtils
[+] Finish NewLSWin32Source
[+] AuTryFindByTupleN, AuTryRemoveByTupleN
[+] Separated AuRead/Write types, now in auTypeUtils
[+] Added GetPosition/SetPosition to FileWriter
[*] Fix stupid AuMin in place of AuMax in SpawnThread.Unix.Cpp
[*] Refactored Arbitrary readers to SeekingReaders (as in, they could be atomic and/or parallelized, and accept an arbitrary position as a work parameter -> not Seekable, as in, you can simply set the position)
[*] Hack back in the sched deinit
[+] File AIO loop source interop
[+] Begin to prototype a LoopQueue object I had in mind for NT, untested btw
[+] Stub code for networking
[+] Compression BaseStream/IngestableStreamBase
[*] Major: read/write locks now support write-entrant read routines.
[*] Compression subsystem now uses the MemoryView concept
[*] Rewrite the base stream compressions, made them less broken
[*] Update hashing api
[*] WriterTryGoForward and ReaderTryGoForward now revert to the previous relative index instead of panicing
[+] Added new AuByteBuffer apis
Trim, Pad, WriteFrom, WriteString, [TODO: ReadString]
[+] Added ByteBufferPushReadState
[+] Added ByteBufferPushWriteState
[*] Move from USC-16 to full UTF-16. Win32 can handle full UTF-16.
[*] ELogLevel is now an Aurora enum
[+] Raised arbitrary limit in header to 255, the max filter buffer
[+] Explicit GZip support
[+] Explicit Zip support
[+] Added [some] compressors
et al
2022-02-17 00:11:40 +00:00
static AuString gProgramsFolder ;
2021-06-27 21:25:29 +00:00
static AuString gApplicationData ;
2021-09-06 10:58:08 +00:00
static AuOptional < AuString > gSystemLibPath ;
static AuOptional < AuString > gSystemLibPath2 ;
static AuOptional < AuString > gUserLibPath ;
static AuOptional < AuString > gUserLibPath2 ;
2024-03-10 15:00:13 +00:00
static AuString gTempDir ;
2021-12-24 15:44:51 +00:00
// Should the following be /opt? Probably, if it were a direct replacement for Windows' appdata on Linux for global software packages outside of our ecosystem, sure; however, this is strictly a fallback for when there is no home
2024-03-11 21:05:03 +00:00
// We don't support initially-undefined global application configurations across users on Unix targets. We can therefore conclude the application running is a service whose user is without a home, and should be subject to the same rules as daemon deployed by a real package manager
2021-12-24 15:44:51 +00:00
// For internal packages, in our own ecosystem of tools, I think this follows the UNIX spec, not that I care what arcahic C-with-vendor-packages-as-an-OS specification says.
// The only way you can break this assumption is if you argue for users who will be outside of our deployment pipeline, wanting global configs, and don't have write permission on a relevant global directory.
// They can shove it. Superuser should install software for all users.
2024-03-11 21:05:03 +00:00
// We should use:
// 2> XDG envvars (with a fallback to a home relative path) for non-root installs; for special installs via package manager, use /var;
// 2> for root installs of an application whose system configs should be shared amongst all users, unsupported, idc, it's sandboxed per user.
// we don't have any good examples of home family computer-esc posix machines
2022-04-05 02:36:39 +00:00
static const char * kUnixAppData { " /var " } ;
2021-06-27 21:25:29 +00:00
2024-03-11 21:05:03 +00:00
AUKN_SYM AuOptional < const AuString & > GetSystemDomain ( )
2021-06-27 21:25:29 +00:00
{
2024-03-11 21:05:03 +00:00
return gApplicationData . size ( ) ?
gApplicationData :
AuOptional < const AuString & > { } ;
2021-06-27 21:25:29 +00:00
}
2024-03-11 21:05:03 +00:00
AUKN_SYM AuOptional < const AuString & > GetProfileDomain ( )
2021-06-27 21:25:29 +00:00
{
2024-03-11 21:05:03 +00:00
return gHomeDirectory . size ( ) ?
gHomeDirectory :
AuOptional < const AuString & > { } ;
2021-06-27 21:25:29 +00:00
}
AUKN_SYM bool GetSystemResourcePath ( const AuString & fileName , AuString & path )
{
path . clear ( ) ;
if ( fileName . find ( " .. " ) ! = AuString : : npos )
{
2022-01-24 18:37:06 +00:00
AuLogWarn ( " Exploit Attempt? A system resource path may not contain relative directory move tokens: {} " , fileName ) ;
2021-06-27 21:25:29 +00:00
return false ;
}
2024-03-11 21:22:24 +00:00
# if defined(AU_CFG_ID_INTERNAL) || defined(AU_CFG_ID_DEBUG)
2021-06-27 21:25:29 +00:00
{
AuString tempPath ;
if ( Process : : GetWorkingDirectory ( tempPath ) )
{
tempPath + = " / " + fileName ;
if ( FileExists ( tempPath ) )
{
path = tempPath ;
return true ;
}
}
}
2024-03-11 21:22:24 +00:00
# endif
2021-06-27 21:25:29 +00:00
{
2023-12-13 18:11:35 +00:00
if ( auto pProcPath = Process : : GetProcessDirectory ( ) )
2021-06-27 21:25:29 +00:00
{
2023-12-13 18:11:35 +00:00
auto tempPath = * pProcPath + " / " + fileName ;
2021-06-27 21:25:29 +00:00
if ( FileExists ( tempPath ) )
{
path = tempPath ;
return true ;
}
}
}
2024-03-11 21:22:24 +00:00
{
if ( auto optPackagePath = GetPackagePath ( ) )
{
auto tempPath = * optPackagePath + " / " + fileName ;
if ( auto pProcPath = Process : : GetProcessDirectory ( ) )
{
auto tempPath2 = * pProcPath + " / " + fileName ;
if ( tempPath2 = = tempPath )
{
// nop
}
else if ( FileExists ( tempPath ) )
{
path = tempPath ;
return true ;
}
}
else if ( FileExists ( tempPath ) )
{
path = tempPath ;
return true ;
}
}
}
# if defined(AU_CFG_ID_SHIP)
{
AuString tempPath ;
if ( Process : : GetWorkingDirectory ( tempPath ) )
{
tempPath + = " / " + fileName ;
if ( FileExists ( tempPath ) )
{
path = tempPath ;
return true ;
}
}
}
# endif
2023-12-13 18:11:35 +00:00
2021-06-30 12:00:32 +00:00
{
auto systemPath = gHomeDirectory + fileName ;
if ( FileExists ( systemPath ) )
{
path = systemPath ;
return true ;
}
}
2021-06-27 21:25:29 +00:00
{
2021-06-30 12:00:32 +00:00
auto systemPath = gApplicationData + fileName ;
2021-06-27 21:25:29 +00:00
if ( FileExists ( systemPath ) )
{
path = systemPath ;
return true ;
}
}
return false ;
}
# if defined(AURORA_PLATFORM_WIN32)
2023-07-24 06:17:08 +00:00
static AuOptional < int > GUIDTOCISL ( REFKNOWNFOLDERID rfid )
{
if ( rfid = = FOLDERID_RoamingAppData )
{
return CSIDL_APPDATA ;
}
if ( rfid = = FOLDERID_ProgramData )
{
return CSIDL_COMMON_APPDATA ;
}
2024-03-10 15:00:13 +00:00
if ( rfid = = FOLDERID_Documents )
{
return CSIDL_COMMON_DOCUMENTS ;
}
2023-12-01 06:20:39 +00:00
if ( rfid = = FOLDERID_System | |
rfid = = FOLDERID_SystemX86 )
2023-07-24 06:17:08 +00:00
{
return CSIDL_SYSTEM ;
}
if ( rfid = = FOLDERID_Profile )
{
return CSIDL_PROFILE ;
}
return { } ;
}
2023-09-17 20:33:14 +00:00
static AuString GetSpecialDirOldOS ( REFKNOWNFOLDERID rfid )
2021-06-27 21:25:29 +00:00
{
2023-09-17 20:33:14 +00:00
if ( ! pSHGetFolderPathA )
{
return " " ;
}
2023-07-24 06:17:08 +00:00
2023-09-17 20:33:14 +00:00
if ( auto opt = GUIDTOCISL ( rfid ) )
2023-07-24 06:17:08 +00:00
{
2023-09-17 20:33:14 +00:00
AuString temp ( MAX_PATH , ' \x00 ' ) ;
if ( pSHGetFolderPathA ( 0 , * opt , 0 , 0 , temp . data ( ) ) = = S_OK )
2023-07-24 06:17:08 +00:00
{
2023-09-17 20:33:14 +00:00
return temp ;
2023-07-24 06:17:08 +00:00
}
2023-09-17 20:33:14 +00:00
}
2023-09-17 21:21:24 +00:00
return " " ;
2023-09-17 20:33:14 +00:00
}
static AuString GetSpecialDir ( REFKNOWNFOLDERID rfid )
{
PWSTR directory ;
if ( ! pSHGetKnownFolderPath )
{
return GetSpecialDirOldOS ( rfid ) ;
}
2023-07-24 06:17:08 +00:00
if ( pSHGetKnownFolderPath ( rfid , KF_FLAG_DEFAULT , NULL , & directory ) ! = S_OK )
2021-06-27 21:25:29 +00:00
{
2023-09-17 20:33:14 +00:00
AuString str ;
if ( ( str = GetSpecialDirOldOS ( rfid ) ) . size ( ) )
{
return str ;
}
2024-03-12 04:32:45 +00:00
if ( rfid = = FOLDERID_UserProgramFiles )
{
return " " ;
}
2021-06-27 21:25:29 +00:00
SysPanic ( " Couldn't get known special directory path of [MS:{}-{}-{}-{}{}{}{}{}{}{}{}] with a NULL access token " ,
rfid . Data1 , rfid . Data2 , rfid . Data3 , rfid . Data4 [ 0 ] , rfid . Data4 [ 1 ] , rfid . Data4 [ 2 ] , rfid . Data4 [ 3 ] , rfid . Data4 [ 4 ] , rfid . Data4 [ 5 ] , rfid . Data4 [ 6 ] , rfid . Data4 [ 7 ] ) ;
}
2023-06-28 09:33:12 +00:00
auto ret = Locale : : ConvertFromWChar ( directory ) ;
2023-09-17 20:33:14 +00:00
if ( pCoTaskMemFree )
{
pCoTaskMemFree ( directory ) ;
}
2023-06-28 09:33:12 +00:00
return ret ;
2021-06-27 21:25:29 +00:00
}
2022-01-18 14:26:38 +00:00
2021-06-27 21:25:29 +00:00
static void SetNamespaceDirectories ( )
{
gHomeDirectory = GetSpecialDir ( FOLDERID_RoamingAppData ) ;
gApplicationData = GetSpecialDir ( FOLDERID_ProgramData ) ;
2023-12-01 02:21:58 +00:00
if constexpr ( AuBuild : : IsPlatformX32 ( ) )
{
gSystemLibPath = GetSpecialDir ( FOLDERID_SystemX86 ) ;
}
else
{
gSystemLibPath = GetSpecialDir ( FOLDERID_System ) ;
}
2022-01-18 14:26:38 +00:00
gUserHomeDirectory = GetSpecialDir ( FOLDERID_Profile ) ;
gAdminWritableAppDirectory = gApplicationData ;
gUserWritableAppData = gHomeDirectory ;
2023-08-18 17:03:05 +00:00
gProgramsFolder = AuSwInfo : : IsWindows7OrGreater ( ) ? GetSpecialDir ( FOLDERID_UserProgramFiles ) : " " ;
if ( gProgramsFolder . empty ( ) )
{
gProgramsFolder = GetSpecialDir ( FOLDERID_Documents ) ;
if ( gProgramsFolder . size ( ) )
{
gProgramsFolder + = " \\ Programs " ;
if ( ! AuFS : : DirExists ( gProgramsFolder ) )
{
AuFS : : DirMk ( gProgramsFolder ) ;
}
}
}
2024-03-10 15:00:13 +00:00
if ( pGetTempPathW )
{
wchar_t tempPath [ 2048 ] ;
if ( auto uLength = pGetTempPathW ( AuArraySize ( tempPath ) , tempPath ) )
{
gTempDir = AuLocale : : ConvertFromWChar ( tempPath , uLength ) ;
}
}
if ( gTempDir . empty ( ) )
{
gTempDir = GetSpecialDir ( FOLDERID_Documents ) + " /Temp/ " ;
}
2021-06-27 21:25:29 +00:00
}
2021-09-06 10:58:08 +00:00
# elif defined(AURORA_PLATFORM_LINUX) || defined(AURORA_PLATFORM_BSD)
static void SetUnixPaths ( AuOptional < AuString > & primary , AuOptional < AuString > & secondary , const AuString & base )
{
primary = base ;
if ( Aurora : : Build : : IsPlatformX32 ( ) )
{
secondary = base + " 32 " ;
}
else
{
secondary = base + " 64 " ;
}
if ( DirExists ( * secondary ) )
{
2022-03-30 11:33:52 +00:00
AuSwap ( secondary , primary ) ;
2021-09-06 10:58:08 +00:00
}
else
{
secondary . reset ( ) ;
}
if ( ! DirExists ( * primary ) )
{
primary . reset ( ) ;
}
}
2021-06-27 21:25:29 +00:00
2021-11-05 17:34:23 +00:00
static void SetXdg ( AuString & out , const char * envvar , const char * home , const char * defaultHomeExt , const char * fallback )
{
auto value = getenv ( envvar ) ;
if ( value )
{
out = value ;
}
else if ( home )
{
out = AuString ( home ) + defaultHomeExt ;
}
else
{
out = fallback ;
}
}
2021-06-27 21:25:29 +00:00
static void SetNamespaceDirectories ( )
{
const char * homedir ;
homedir = getenv ( " HOME " ) ;
if ( ! homedir )
{
homedir = getpwuid ( getuid ( ) ) - > pw_dir ;
}
2022-01-18 14:26:38 +00:00
gUserHomeDirectory = homedir ;
2021-11-05 17:34:23 +00:00
// XDG Base Directory Specification
// $XDG_CONFIG_HOME defines the base directory relative to which user-specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.
// $XDG_DATA_HOME defines the base directory relative to which user-specific data files should be stored
SetXdg ( gApplicationData , " XDG_CONFIG_HOME " , homedir , " /.config " , kUnixAppData ) ;
SetXdg ( gHomeDirectory , " XDG_DATA_HOME " , homedir , " /.local/share " , " . " ) ;
2021-09-06 10:58:08 +00:00
2021-11-15 19:35:15 +00:00
// https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/
// Arch 2012: https://archlinux.org/news/the-lib-directory-becomes-a-symlink/
// Ubuntu 2018 (mandatory 2021+): https://lists.ubuntu.com/archives/ubuntu-devel-announce/2018-November/001253.html https://wiki.debian.org/UsrMerge
// Fedora (2011?): https://fedoraproject.org/wiki/Features/UsrMove
SetUnixPaths ( gUserLibPath , gUserLibPath2 , " /usr/local/lib " ) ;
SetUnixPaths ( gSystemLibPath , gSystemLibPath2 , " /usr/lib " ) ;
2022-01-18 14:26:38 +00:00
[*/+/-] MEGA COMMIT. ~2 weeks compressed.
The intention is to quickly improve and add util apis, enhance functionality given current demands, go back to the build pipeline, finish that, publish runtime tests, and then use what we have to go back to to linux support with a more stable api.
[+] AuMakeSharedArray
[+] Technet ArgvQuote
[+] Grug subsystem (UNIX signal thread async safe ipc + telemetry flusher + log flusher.)
[+] auEndianness -> Endian swap utils
[+] AuGet<N>(...)
[*] AUE_DEFINE conversion for
ECompresionType, EAnsiColor, EHashType, EStreamError, EHexDump
[+] ConsoleMessage ByteBuffer serialization
[+] CmdLine subsystem for parsing command line arguments and simple switch/flag checks
[*] Split logger from console subsystem
[+] StartupParameters -> A part of a clean up effort under Process
[*] Refactor SysErrors header + get caller hack
[+] Atomic APIs
[+] popcnt
[+] Ring Buffer sink
[+] Added more standard errors
Catch,
Submission,
LockError,
NoAccess,
ResourceMissing,
ResourceLocked,
MalformedData,
InSandboxContext,
ParseError
[+] Added ErrorCategorySet, ErrorCategoryClear, GetStackTrace
[+] IExitSubscriber, ETriggerLevel
[*] Write bias the high performance RWLockImpl read-lock operation operation
[+] ExitHandlerAdd/ExitHandlerRemove (exit subsystem)
[*] Updated API style
Digests
[+] CpuId::CpuBitCount
[+] GetUserProgramsFolder
[+] GetPackagePath
[*] Split IStreamReader with an inl file
[*] BlobWriter/BlobReader/BlobArbitraryReader can now take shared pointers to bytebuffers. default constructor allocates a new scalable bytebuffer
[+] ICharacterProvider
[+] ICharacterProviderEx
[+] IBufferedCharacterConsumer
[+] ProviderFromSharedString
[+] ProviderFromString
[+] BufferConsumerFromProvider
[*] Parse Subsystem uses character io bufferer
[*] Rewritten NT's high perf semaphore to use userland SRW/ConVars [like mutex, based on generic semaphore]
[+] ByteBuffer::ResetReadPointer
[*] Bug fix bytebuffer base not reset on free and some scaling issues
[+] ProcessMap -> Added kSectionNameStack, kSectionNameFile, kSectionNameHeap for Section
[*] ProcessMap -> Refactor Segment to Section. I was stupid for keeping a type conflict hack API facing
[+] Added 64 *byte* fast RNG seeds
[+] File Advisorys/File Lock Awareness
[+] Added extended IAuroraThread from OS identifier caches for debug purposes
[*] Tweaked how memory is reported on Windows. Better consistency of what values mean across functions.
[*] Broke AuroraUtils/Typedefs out into a separate library
[*] Update build script
[+] Put some more effort into adding detail to the readme before rewriting it, plus, added some media
[*] Improved public API documentation
[*] Bug fix `SetConsoleCtrlHandler`
[+] Locale TimeDateToFileNameISO8601
[+] Console config stdOutShortTime
[*] Begin using internal UTF8/16 decoders when platform support isnt available (instead of stl)
[*] Bug fixes in decoders
[*] Major bug fix, AuMax
[+] RateLimiter
[+] Binary file sink
[+] Log directory sink
[*] Data header usability (more operators)
[+] AuRemoveRange
[+] AuRemove
[+] AuTryRemove
[+] AuTryRemoveRange
[+] auCastUtils
[+] Finish NewLSWin32Source
[+] AuTryFindByTupleN, AuTryRemoveByTupleN
[+] Separated AuRead/Write types, now in auTypeUtils
[+] Added GetPosition/SetPosition to FileWriter
[*] Fix stupid AuMin in place of AuMax in SpawnThread.Unix.Cpp
[*] Refactored Arbitrary readers to SeekingReaders (as in, they could be atomic and/or parallelized, and accept an arbitrary position as a work parameter -> not Seekable, as in, you can simply set the position)
[*] Hack back in the sched deinit
[+] File AIO loop source interop
[+] Begin to prototype a LoopQueue object I had in mind for NT, untested btw
[+] Stub code for networking
[+] Compression BaseStream/IngestableStreamBase
[*] Major: read/write locks now support write-entrant read routines.
[*] Compression subsystem now uses the MemoryView concept
[*] Rewrite the base stream compressions, made them less broken
[*] Update hashing api
[*] WriterTryGoForward and ReaderTryGoForward now revert to the previous relative index instead of panicing
[+] Added new AuByteBuffer apis
Trim, Pad, WriteFrom, WriteString, [TODO: ReadString]
[+] Added ByteBufferPushReadState
[+] Added ByteBufferPushWriteState
[*] Move from USC-16 to full UTF-16. Win32 can handle full UTF-16.
[*] ELogLevel is now an Aurora enum
[+] Raised arbitrary limit in header to 255, the max filter buffer
[+] Explicit GZip support
[+] Explicit Zip support
[+] Added [some] compressors
et al
2022-02-17 00:11:40 +00:00
gProgramsFolder = " /opt " ;
2022-01-18 14:26:38 +00:00
gGlobalWritableAppDirectory = " /opt " ;
gAdminWritableAppDirectory = kUnixAppData ;
gUserWritableAppData = gApplicationData ;
2024-03-10 15:00:13 +00:00
// iOS/MacOS : NSTemporaryDirectory
# if defined(AURORA_PLATFORM_ANDROID)
gTempDir = " /data/local/tmp/ " ;
# else
gTempDir = " /tmp/ " ;
# endif
2021-06-27 21:25:29 +00:00
}
# else
static void SetNamespaceDirectories ( )
{
gHomeDirectory = " . " ;
gApplicationData = " . " ;
}
# endif
2021-09-06 10:58:08 +00:00
AuOptional < AuString > GetSystemLibPath ( )
{
return gSystemLibPath ;
}
AuOptional < AuString > GetUserLibPath ( )
{
return gUserLibPath ;
}
AuOptional < AuString > GetSystemLibPath2 ( )
{
return gSystemLibPath2 ;
}
AuOptional < AuString > GetUserLibPath2 ( )
{
return gUserLibPath2 ;
}
2021-06-27 21:25:29 +00:00
static void ChangeDir ( )
{
2021-07-13 13:07:22 +00:00
# if !defined(AU_NO_AU_HOME_BRANDING)
2023-08-29 20:10:53 +00:00
if ( gRuntimeConfig . fio . optDefaultBrand )
2021-09-06 10:58:08 +00:00
{
2022-03-30 11:33:52 +00:00
# if !defined(AURORA_PLATFORM_WIN32)
2023-08-29 20:10:53 +00:00
gApplicationData + = " / " + gRuntimeConfig . fio . optDefaultBrand . value ( ) ;
2022-03-30 11:33:52 +00:00
# endif
2023-08-29 20:10:53 +00:00
gHomeDirectory + = " / " + gRuntimeConfig . fio . optDefaultBrand . value ( ) ;
gProgramsFolder + = " / " + gRuntimeConfig . fio . optDefaultBrand . value ( ) ;
2021-09-06 10:58:08 +00:00
}
2021-07-13 13:07:22 +00:00
# endif
2021-09-06 10:58:08 +00:00
2021-12-24 15:44:51 +00:00
# if defined(AURORA_PLATFORM_WIN32)
2022-03-30 11:33:52 +00:00
gApplicationData + = " \\ AllUsers " ;
2021-12-24 15:44:51 +00:00
if ( ! FS : : DirExists ( gApplicationData ) )
{
if ( FS : : DirMk ( gApplicationData ) )
{
Win32FixGlobalAppDataAcl ( gApplicationData ) ;
}
}
2022-03-30 11:33:52 +00:00
# if defined(AURORA_PLATFORM_WIN32)
2023-08-29 20:10:53 +00:00
if ( gRuntimeConfig . fio . optDefaultBrand )
2022-03-30 11:33:52 +00:00
{
2023-08-29 20:10:53 +00:00
gApplicationData + = " \\ " + gRuntimeConfig . fio . optDefaultBrand . value ( ) ;
2022-03-30 11:33:52 +00:00
}
# endif
FS : : DirMk ( gApplicationData ) ;
2021-12-24 15:44:51 +00:00
# endif
[*/+/-] MEGA COMMIT. ~2 weeks compressed.
The intention is to quickly improve and add util apis, enhance functionality given current demands, go back to the build pipeline, finish that, publish runtime tests, and then use what we have to go back to to linux support with a more stable api.
[+] AuMakeSharedArray
[+] Technet ArgvQuote
[+] Grug subsystem (UNIX signal thread async safe ipc + telemetry flusher + log flusher.)
[+] auEndianness -> Endian swap utils
[+] AuGet<N>(...)
[*] AUE_DEFINE conversion for
ECompresionType, EAnsiColor, EHashType, EStreamError, EHexDump
[+] ConsoleMessage ByteBuffer serialization
[+] CmdLine subsystem for parsing command line arguments and simple switch/flag checks
[*] Split logger from console subsystem
[+] StartupParameters -> A part of a clean up effort under Process
[*] Refactor SysErrors header + get caller hack
[+] Atomic APIs
[+] popcnt
[+] Ring Buffer sink
[+] Added more standard errors
Catch,
Submission,
LockError,
NoAccess,
ResourceMissing,
ResourceLocked,
MalformedData,
InSandboxContext,
ParseError
[+] Added ErrorCategorySet, ErrorCategoryClear, GetStackTrace
[+] IExitSubscriber, ETriggerLevel
[*] Write bias the high performance RWLockImpl read-lock operation operation
[+] ExitHandlerAdd/ExitHandlerRemove (exit subsystem)
[*] Updated API style
Digests
[+] CpuId::CpuBitCount
[+] GetUserProgramsFolder
[+] GetPackagePath
[*] Split IStreamReader with an inl file
[*] BlobWriter/BlobReader/BlobArbitraryReader can now take shared pointers to bytebuffers. default constructor allocates a new scalable bytebuffer
[+] ICharacterProvider
[+] ICharacterProviderEx
[+] IBufferedCharacterConsumer
[+] ProviderFromSharedString
[+] ProviderFromString
[+] BufferConsumerFromProvider
[*] Parse Subsystem uses character io bufferer
[*] Rewritten NT's high perf semaphore to use userland SRW/ConVars [like mutex, based on generic semaphore]
[+] ByteBuffer::ResetReadPointer
[*] Bug fix bytebuffer base not reset on free and some scaling issues
[+] ProcessMap -> Added kSectionNameStack, kSectionNameFile, kSectionNameHeap for Section
[*] ProcessMap -> Refactor Segment to Section. I was stupid for keeping a type conflict hack API facing
[+] Added 64 *byte* fast RNG seeds
[+] File Advisorys/File Lock Awareness
[+] Added extended IAuroraThread from OS identifier caches for debug purposes
[*] Tweaked how memory is reported on Windows. Better consistency of what values mean across functions.
[*] Broke AuroraUtils/Typedefs out into a separate library
[*] Update build script
[+] Put some more effort into adding detail to the readme before rewriting it, plus, added some media
[*] Improved public API documentation
[*] Bug fix `SetConsoleCtrlHandler`
[+] Locale TimeDateToFileNameISO8601
[+] Console config stdOutShortTime
[*] Begin using internal UTF8/16 decoders when platform support isnt available (instead of stl)
[*] Bug fixes in decoders
[*] Major bug fix, AuMax
[+] RateLimiter
[+] Binary file sink
[+] Log directory sink
[*] Data header usability (more operators)
[+] AuRemoveRange
[+] AuRemove
[+] AuTryRemove
[+] AuTryRemoveRange
[+] auCastUtils
[+] Finish NewLSWin32Source
[+] AuTryFindByTupleN, AuTryRemoveByTupleN
[+] Separated AuRead/Write types, now in auTypeUtils
[+] Added GetPosition/SetPosition to FileWriter
[*] Fix stupid AuMin in place of AuMax in SpawnThread.Unix.Cpp
[*] Refactored Arbitrary readers to SeekingReaders (as in, they could be atomic and/or parallelized, and accept an arbitrary position as a work parameter -> not Seekable, as in, you can simply set the position)
[*] Hack back in the sched deinit
[+] File AIO loop source interop
[+] Begin to prototype a LoopQueue object I had in mind for NT, untested btw
[+] Stub code for networking
[+] Compression BaseStream/IngestableStreamBase
[*] Major: read/write locks now support write-entrant read routines.
[*] Compression subsystem now uses the MemoryView concept
[*] Rewrite the base stream compressions, made them less broken
[*] Update hashing api
[*] WriterTryGoForward and ReaderTryGoForward now revert to the previous relative index instead of panicing
[+] Added new AuByteBuffer apis
Trim, Pad, WriteFrom, WriteString, [TODO: ReadString]
[+] Added ByteBufferPushReadState
[+] Added ByteBufferPushWriteState
[*] Move from USC-16 to full UTF-16. Win32 can handle full UTF-16.
[*] ELogLevel is now an Aurora enum
[+] Raised arbitrary limit in header to 255, the max filter buffer
[+] Explicit GZip support
[+] Explicit Zip support
[+] Added [some] compressors
et al
2022-02-17 00:11:40 +00:00
NormalizePath ( gProgramsFolder ) ;
2021-06-27 21:25:29 +00:00
NormalizePath ( gHomeDirectory ) ;
2021-11-05 17:34:23 +00:00
[*/+/-] MEGA COMMIT. ~2 weeks compressed.
The intention is to quickly improve and add util apis, enhance functionality given current demands, go back to the build pipeline, finish that, publish runtime tests, and then use what we have to go back to to linux support with a more stable api.
[+] AuMakeSharedArray
[+] Technet ArgvQuote
[+] Grug subsystem (UNIX signal thread async safe ipc + telemetry flusher + log flusher.)
[+] auEndianness -> Endian swap utils
[+] AuGet<N>(...)
[*] AUE_DEFINE conversion for
ECompresionType, EAnsiColor, EHashType, EStreamError, EHexDump
[+] ConsoleMessage ByteBuffer serialization
[+] CmdLine subsystem for parsing command line arguments and simple switch/flag checks
[*] Split logger from console subsystem
[+] StartupParameters -> A part of a clean up effort under Process
[*] Refactor SysErrors header + get caller hack
[+] Atomic APIs
[+] popcnt
[+] Ring Buffer sink
[+] Added more standard errors
Catch,
Submission,
LockError,
NoAccess,
ResourceMissing,
ResourceLocked,
MalformedData,
InSandboxContext,
ParseError
[+] Added ErrorCategorySet, ErrorCategoryClear, GetStackTrace
[+] IExitSubscriber, ETriggerLevel
[*] Write bias the high performance RWLockImpl read-lock operation operation
[+] ExitHandlerAdd/ExitHandlerRemove (exit subsystem)
[*] Updated API style
Digests
[+] CpuId::CpuBitCount
[+] GetUserProgramsFolder
[+] GetPackagePath
[*] Split IStreamReader with an inl file
[*] BlobWriter/BlobReader/BlobArbitraryReader can now take shared pointers to bytebuffers. default constructor allocates a new scalable bytebuffer
[+] ICharacterProvider
[+] ICharacterProviderEx
[+] IBufferedCharacterConsumer
[+] ProviderFromSharedString
[+] ProviderFromString
[+] BufferConsumerFromProvider
[*] Parse Subsystem uses character io bufferer
[*] Rewritten NT's high perf semaphore to use userland SRW/ConVars [like mutex, based on generic semaphore]
[+] ByteBuffer::ResetReadPointer
[*] Bug fix bytebuffer base not reset on free and some scaling issues
[+] ProcessMap -> Added kSectionNameStack, kSectionNameFile, kSectionNameHeap for Section
[*] ProcessMap -> Refactor Segment to Section. I was stupid for keeping a type conflict hack API facing
[+] Added 64 *byte* fast RNG seeds
[+] File Advisorys/File Lock Awareness
[+] Added extended IAuroraThread from OS identifier caches for debug purposes
[*] Tweaked how memory is reported on Windows. Better consistency of what values mean across functions.
[*] Broke AuroraUtils/Typedefs out into a separate library
[*] Update build script
[+] Put some more effort into adding detail to the readme before rewriting it, plus, added some media
[*] Improved public API documentation
[*] Bug fix `SetConsoleCtrlHandler`
[+] Locale TimeDateToFileNameISO8601
[+] Console config stdOutShortTime
[*] Begin using internal UTF8/16 decoders when platform support isnt available (instead of stl)
[*] Bug fixes in decoders
[*] Major bug fix, AuMax
[+] RateLimiter
[+] Binary file sink
[+] Log directory sink
[*] Data header usability (more operators)
[+] AuRemoveRange
[+] AuRemove
[+] AuTryRemove
[+] AuTryRemoveRange
[+] auCastUtils
[+] Finish NewLSWin32Source
[+] AuTryFindByTupleN, AuTryRemoveByTupleN
[+] Separated AuRead/Write types, now in auTypeUtils
[+] Added GetPosition/SetPosition to FileWriter
[*] Fix stupid AuMin in place of AuMax in SpawnThread.Unix.Cpp
[*] Refactored Arbitrary readers to SeekingReaders (as in, they could be atomic and/or parallelized, and accept an arbitrary position as a work parameter -> not Seekable, as in, you can simply set the position)
[*] Hack back in the sched deinit
[+] File AIO loop source interop
[+] Begin to prototype a LoopQueue object I had in mind for NT, untested btw
[+] Stub code for networking
[+] Compression BaseStream/IngestableStreamBase
[*] Major: read/write locks now support write-entrant read routines.
[*] Compression subsystem now uses the MemoryView concept
[*] Rewrite the base stream compressions, made them less broken
[*] Update hashing api
[*] WriterTryGoForward and ReaderTryGoForward now revert to the previous relative index instead of panicing
[+] Added new AuByteBuffer apis
Trim, Pad, WriteFrom, WriteString, [TODO: ReadString]
[+] Added ByteBufferPushReadState
[+] Added ByteBufferPushWriteState
[*] Move from USC-16 to full UTF-16. Win32 can handle full UTF-16.
[*] ELogLevel is now an Aurora enum
[+] Raised arbitrary limit in header to 255, the max filter buffer
[+] Explicit GZip support
[+] Explicit Zip support
[+] Added [some] compressors
et al
2022-02-17 00:11:40 +00:00
if ( ( gApplicationData = = gHomeDirectory ) | | ( gApplicationData = = gProgramsFolder ) )
2021-11-05 17:34:23 +00:00
{
gApplicationData + = kPathSplitter ;
gHomeDirectory + = kPathSplitter ;
gApplicationData + = " System " ;
gHomeDirectory + = " Profile " ;
}
2021-06-27 21:25:29 +00:00
2021-07-13 13:07:22 +00:00
// Noting we append a path splitter to prevent hair pulling over missing path delimiters
// Eg: GetHome() + "myAwesomeApp/Config" = %HOME%/Aurora/ProfilemyAwsomeApp/Config
2021-06-27 21:25:29 +00:00
gApplicationData + = kPathSplitter ;
gHomeDirectory + = kPathSplitter ;
[*/+/-] MEGA COMMIT. ~2 weeks compressed.
The intention is to quickly improve and add util apis, enhance functionality given current demands, go back to the build pipeline, finish that, publish runtime tests, and then use what we have to go back to to linux support with a more stable api.
[+] AuMakeSharedArray
[+] Technet ArgvQuote
[+] Grug subsystem (UNIX signal thread async safe ipc + telemetry flusher + log flusher.)
[+] auEndianness -> Endian swap utils
[+] AuGet<N>(...)
[*] AUE_DEFINE conversion for
ECompresionType, EAnsiColor, EHashType, EStreamError, EHexDump
[+] ConsoleMessage ByteBuffer serialization
[+] CmdLine subsystem for parsing command line arguments and simple switch/flag checks
[*] Split logger from console subsystem
[+] StartupParameters -> A part of a clean up effort under Process
[*] Refactor SysErrors header + get caller hack
[+] Atomic APIs
[+] popcnt
[+] Ring Buffer sink
[+] Added more standard errors
Catch,
Submission,
LockError,
NoAccess,
ResourceMissing,
ResourceLocked,
MalformedData,
InSandboxContext,
ParseError
[+] Added ErrorCategorySet, ErrorCategoryClear, GetStackTrace
[+] IExitSubscriber, ETriggerLevel
[*] Write bias the high performance RWLockImpl read-lock operation operation
[+] ExitHandlerAdd/ExitHandlerRemove (exit subsystem)
[*] Updated API style
Digests
[+] CpuId::CpuBitCount
[+] GetUserProgramsFolder
[+] GetPackagePath
[*] Split IStreamReader with an inl file
[*] BlobWriter/BlobReader/BlobArbitraryReader can now take shared pointers to bytebuffers. default constructor allocates a new scalable bytebuffer
[+] ICharacterProvider
[+] ICharacterProviderEx
[+] IBufferedCharacterConsumer
[+] ProviderFromSharedString
[+] ProviderFromString
[+] BufferConsumerFromProvider
[*] Parse Subsystem uses character io bufferer
[*] Rewritten NT's high perf semaphore to use userland SRW/ConVars [like mutex, based on generic semaphore]
[+] ByteBuffer::ResetReadPointer
[*] Bug fix bytebuffer base not reset on free and some scaling issues
[+] ProcessMap -> Added kSectionNameStack, kSectionNameFile, kSectionNameHeap for Section
[*] ProcessMap -> Refactor Segment to Section. I was stupid for keeping a type conflict hack API facing
[+] Added 64 *byte* fast RNG seeds
[+] File Advisorys/File Lock Awareness
[+] Added extended IAuroraThread from OS identifier caches for debug purposes
[*] Tweaked how memory is reported on Windows. Better consistency of what values mean across functions.
[*] Broke AuroraUtils/Typedefs out into a separate library
[*] Update build script
[+] Put some more effort into adding detail to the readme before rewriting it, plus, added some media
[*] Improved public API documentation
[*] Bug fix `SetConsoleCtrlHandler`
[+] Locale TimeDateToFileNameISO8601
[+] Console config stdOutShortTime
[*] Begin using internal UTF8/16 decoders when platform support isnt available (instead of stl)
[*] Bug fixes in decoders
[*] Major bug fix, AuMax
[+] RateLimiter
[+] Binary file sink
[+] Log directory sink
[*] Data header usability (more operators)
[+] AuRemoveRange
[+] AuRemove
[+] AuTryRemove
[+] AuTryRemoveRange
[+] auCastUtils
[+] Finish NewLSWin32Source
[+] AuTryFindByTupleN, AuTryRemoveByTupleN
[+] Separated AuRead/Write types, now in auTypeUtils
[+] Added GetPosition/SetPosition to FileWriter
[*] Fix stupid AuMin in place of AuMax in SpawnThread.Unix.Cpp
[*] Refactored Arbitrary readers to SeekingReaders (as in, they could be atomic and/or parallelized, and accept an arbitrary position as a work parameter -> not Seekable, as in, you can simply set the position)
[*] Hack back in the sched deinit
[+] File AIO loop source interop
[+] Begin to prototype a LoopQueue object I had in mind for NT, untested btw
[+] Stub code for networking
[+] Compression BaseStream/IngestableStreamBase
[*] Major: read/write locks now support write-entrant read routines.
[*] Compression subsystem now uses the MemoryView concept
[*] Rewrite the base stream compressions, made them less broken
[*] Update hashing api
[*] WriterTryGoForward and ReaderTryGoForward now revert to the previous relative index instead of panicing
[+] Added new AuByteBuffer apis
Trim, Pad, WriteFrom, WriteString, [TODO: ReadString]
[+] Added ByteBufferPushReadState
[+] Added ByteBufferPushWriteState
[*] Move from USC-16 to full UTF-16. Win32 can handle full UTF-16.
[*] ELogLevel is now an Aurora enum
[+] Raised arbitrary limit in header to 255, the max filter buffer
[+] Explicit GZip support
[+] Explicit Zip support
[+] Added [some] compressors
et al
2022-02-17 00:11:40 +00:00
gProgramsFolder + = kPathSplitter ;
2023-09-04 15:40:37 +00:00
static const auto Fixup = [ ] ( auto & str )
{
if ( str . empty ( ) )
{
return ;
}
if ( str . ends_with ( ' \\ ' ) )
{
return ;
}
if ( str . ends_with ( ' / ' ) )
{
return ;
}
str + = kPathSplitter ;
} ;
Fixup ( gUserHomeDirectory ) ;
Fixup ( gAdminWritableAppDirectory ) ;
Fixup ( gUserWritableAppData ) ;
Fixup ( gGlobalWritableAppDirectory ) ;
2021-06-27 21:25:29 +00:00
}
void InitResources ( )
{
2023-06-28 09:33:12 +00:00
DeinitResources ( ) ;
2021-06-27 21:25:29 +00:00
SetNamespaceDirectories ( ) ;
ChangeDir ( ) ;
}
2021-12-24 15:44:51 +00:00
2023-06-28 09:33:12 +00:00
void DeinitResources ( )
{
gHomeDirectory . clear ( ) ;
gUserHomeDirectory . clear ( ) ;
gUserWritableAppData . clear ( ) ;
gGlobalWritableAppDirectory . clear ( ) ;
gAdminWritableAppDirectory . clear ( ) ;
gProgramsFolder . clear ( ) ;
gApplicationData . clear ( ) ;
}
2024-03-11 21:05:03 +00:00
AUKN_SYM AuOptional < const AuString & > GetAppData ( )
2022-01-18 14:26:38 +00:00
{
2024-03-11 21:05:03 +00:00
return gUserWritableAppData . size ( ) ?
gUserWritableAppData :
AuOptional < const AuString & > { } ;
2022-01-18 14:26:38 +00:00
}
2024-03-11 21:05:03 +00:00
AUKN_SYM AuOptional < const AuString & > GetUserHome ( )
2022-01-18 14:26:38 +00:00
{
2024-03-11 21:05:03 +00:00
return gUserHomeDirectory . size ( ) ?
gUserHomeDirectory :
AuOptional < const AuString & > { } ;
2022-01-18 14:26:38 +00:00
}
2024-03-11 21:05:03 +00:00
AUKN_SYM AuOptional < const AuString & > GetPackagePath ( )
[*/+/-] MEGA COMMIT. ~2 weeks compressed.
The intention is to quickly improve and add util apis, enhance functionality given current demands, go back to the build pipeline, finish that, publish runtime tests, and then use what we have to go back to to linux support with a more stable api.
[+] AuMakeSharedArray
[+] Technet ArgvQuote
[+] Grug subsystem (UNIX signal thread async safe ipc + telemetry flusher + log flusher.)
[+] auEndianness -> Endian swap utils
[+] AuGet<N>(...)
[*] AUE_DEFINE conversion for
ECompresionType, EAnsiColor, EHashType, EStreamError, EHexDump
[+] ConsoleMessage ByteBuffer serialization
[+] CmdLine subsystem for parsing command line arguments and simple switch/flag checks
[*] Split logger from console subsystem
[+] StartupParameters -> A part of a clean up effort under Process
[*] Refactor SysErrors header + get caller hack
[+] Atomic APIs
[+] popcnt
[+] Ring Buffer sink
[+] Added more standard errors
Catch,
Submission,
LockError,
NoAccess,
ResourceMissing,
ResourceLocked,
MalformedData,
InSandboxContext,
ParseError
[+] Added ErrorCategorySet, ErrorCategoryClear, GetStackTrace
[+] IExitSubscriber, ETriggerLevel
[*] Write bias the high performance RWLockImpl read-lock operation operation
[+] ExitHandlerAdd/ExitHandlerRemove (exit subsystem)
[*] Updated API style
Digests
[+] CpuId::CpuBitCount
[+] GetUserProgramsFolder
[+] GetPackagePath
[*] Split IStreamReader with an inl file
[*] BlobWriter/BlobReader/BlobArbitraryReader can now take shared pointers to bytebuffers. default constructor allocates a new scalable bytebuffer
[+] ICharacterProvider
[+] ICharacterProviderEx
[+] IBufferedCharacterConsumer
[+] ProviderFromSharedString
[+] ProviderFromString
[+] BufferConsumerFromProvider
[*] Parse Subsystem uses character io bufferer
[*] Rewritten NT's high perf semaphore to use userland SRW/ConVars [like mutex, based on generic semaphore]
[+] ByteBuffer::ResetReadPointer
[*] Bug fix bytebuffer base not reset on free and some scaling issues
[+] ProcessMap -> Added kSectionNameStack, kSectionNameFile, kSectionNameHeap for Section
[*] ProcessMap -> Refactor Segment to Section. I was stupid for keeping a type conflict hack API facing
[+] Added 64 *byte* fast RNG seeds
[+] File Advisorys/File Lock Awareness
[+] Added extended IAuroraThread from OS identifier caches for debug purposes
[*] Tweaked how memory is reported on Windows. Better consistency of what values mean across functions.
[*] Broke AuroraUtils/Typedefs out into a separate library
[*] Update build script
[+] Put some more effort into adding detail to the readme before rewriting it, plus, added some media
[*] Improved public API documentation
[*] Bug fix `SetConsoleCtrlHandler`
[+] Locale TimeDateToFileNameISO8601
[+] Console config stdOutShortTime
[*] Begin using internal UTF8/16 decoders when platform support isnt available (instead of stl)
[*] Bug fixes in decoders
[*] Major bug fix, AuMax
[+] RateLimiter
[+] Binary file sink
[+] Log directory sink
[*] Data header usability (more operators)
[+] AuRemoveRange
[+] AuRemove
[+] AuTryRemove
[+] AuTryRemoveRange
[+] auCastUtils
[+] Finish NewLSWin32Source
[+] AuTryFindByTupleN, AuTryRemoveByTupleN
[+] Separated AuRead/Write types, now in auTypeUtils
[+] Added GetPosition/SetPosition to FileWriter
[*] Fix stupid AuMin in place of AuMax in SpawnThread.Unix.Cpp
[*] Refactored Arbitrary readers to SeekingReaders (as in, they could be atomic and/or parallelized, and accept an arbitrary position as a work parameter -> not Seekable, as in, you can simply set the position)
[*] Hack back in the sched deinit
[+] File AIO loop source interop
[+] Begin to prototype a LoopQueue object I had in mind for NT, untested btw
[+] Stub code for networking
[+] Compression BaseStream/IngestableStreamBase
[*] Major: read/write locks now support write-entrant read routines.
[*] Compression subsystem now uses the MemoryView concept
[*] Rewrite the base stream compressions, made them less broken
[*] Update hashing api
[*] WriterTryGoForward and ReaderTryGoForward now revert to the previous relative index instead of panicing
[+] Added new AuByteBuffer apis
Trim, Pad, WriteFrom, WriteString, [TODO: ReadString]
[+] Added ByteBufferPushReadState
[+] Added ByteBufferPushWriteState
[*] Move from USC-16 to full UTF-16. Win32 can handle full UTF-16.
[*] ELogLevel is now an Aurora enum
[+] Raised arbitrary limit in header to 255, the max filter buffer
[+] Explicit GZip support
[+] Explicit Zip support
[+] Added [some] compressors
et al
2022-02-17 00:11:40 +00:00
{
// TODO: iOS/mac OS -> CFBundleCopyResourcesDirectoryURL
2024-03-11 21:05:03 +00:00
if ( auto optProcessDirectory = Process : : GetProcessDirectory ( ) )
2023-12-13 18:11:35 +00:00
{
2024-03-11 21:05:03 +00:00
return optProcessDirectory ;
2023-12-13 18:11:35 +00:00
}
2024-03-11 21:05:03 +00:00
return AuOptional < const AuString & > { } ;
[*/+/-] MEGA COMMIT. ~2 weeks compressed.
The intention is to quickly improve and add util apis, enhance functionality given current demands, go back to the build pipeline, finish that, publish runtime tests, and then use what we have to go back to to linux support with a more stable api.
[+] AuMakeSharedArray
[+] Technet ArgvQuote
[+] Grug subsystem (UNIX signal thread async safe ipc + telemetry flusher + log flusher.)
[+] auEndianness -> Endian swap utils
[+] AuGet<N>(...)
[*] AUE_DEFINE conversion for
ECompresionType, EAnsiColor, EHashType, EStreamError, EHexDump
[+] ConsoleMessage ByteBuffer serialization
[+] CmdLine subsystem for parsing command line arguments and simple switch/flag checks
[*] Split logger from console subsystem
[+] StartupParameters -> A part of a clean up effort under Process
[*] Refactor SysErrors header + get caller hack
[+] Atomic APIs
[+] popcnt
[+] Ring Buffer sink
[+] Added more standard errors
Catch,
Submission,
LockError,
NoAccess,
ResourceMissing,
ResourceLocked,
MalformedData,
InSandboxContext,
ParseError
[+] Added ErrorCategorySet, ErrorCategoryClear, GetStackTrace
[+] IExitSubscriber, ETriggerLevel
[*] Write bias the high performance RWLockImpl read-lock operation operation
[+] ExitHandlerAdd/ExitHandlerRemove (exit subsystem)
[*] Updated API style
Digests
[+] CpuId::CpuBitCount
[+] GetUserProgramsFolder
[+] GetPackagePath
[*] Split IStreamReader with an inl file
[*] BlobWriter/BlobReader/BlobArbitraryReader can now take shared pointers to bytebuffers. default constructor allocates a new scalable bytebuffer
[+] ICharacterProvider
[+] ICharacterProviderEx
[+] IBufferedCharacterConsumer
[+] ProviderFromSharedString
[+] ProviderFromString
[+] BufferConsumerFromProvider
[*] Parse Subsystem uses character io bufferer
[*] Rewritten NT's high perf semaphore to use userland SRW/ConVars [like mutex, based on generic semaphore]
[+] ByteBuffer::ResetReadPointer
[*] Bug fix bytebuffer base not reset on free and some scaling issues
[+] ProcessMap -> Added kSectionNameStack, kSectionNameFile, kSectionNameHeap for Section
[*] ProcessMap -> Refactor Segment to Section. I was stupid for keeping a type conflict hack API facing
[+] Added 64 *byte* fast RNG seeds
[+] File Advisorys/File Lock Awareness
[+] Added extended IAuroraThread from OS identifier caches for debug purposes
[*] Tweaked how memory is reported on Windows. Better consistency of what values mean across functions.
[*] Broke AuroraUtils/Typedefs out into a separate library
[*] Update build script
[+] Put some more effort into adding detail to the readme before rewriting it, plus, added some media
[*] Improved public API documentation
[*] Bug fix `SetConsoleCtrlHandler`
[+] Locale TimeDateToFileNameISO8601
[+] Console config stdOutShortTime
[*] Begin using internal UTF8/16 decoders when platform support isnt available (instead of stl)
[*] Bug fixes in decoders
[*] Major bug fix, AuMax
[+] RateLimiter
[+] Binary file sink
[+] Log directory sink
[*] Data header usability (more operators)
[+] AuRemoveRange
[+] AuRemove
[+] AuTryRemove
[+] AuTryRemoveRange
[+] auCastUtils
[+] Finish NewLSWin32Source
[+] AuTryFindByTupleN, AuTryRemoveByTupleN
[+] Separated AuRead/Write types, now in auTypeUtils
[+] Added GetPosition/SetPosition to FileWriter
[*] Fix stupid AuMin in place of AuMax in SpawnThread.Unix.Cpp
[*] Refactored Arbitrary readers to SeekingReaders (as in, they could be atomic and/or parallelized, and accept an arbitrary position as a work parameter -> not Seekable, as in, you can simply set the position)
[*] Hack back in the sched deinit
[+] File AIO loop source interop
[+] Begin to prototype a LoopQueue object I had in mind for NT, untested btw
[+] Stub code for networking
[+] Compression BaseStream/IngestableStreamBase
[*] Major: read/write locks now support write-entrant read routines.
[*] Compression subsystem now uses the MemoryView concept
[*] Rewrite the base stream compressions, made them less broken
[*] Update hashing api
[*] WriterTryGoForward and ReaderTryGoForward now revert to the previous relative index instead of panicing
[+] Added new AuByteBuffer apis
Trim, Pad, WriteFrom, WriteString, [TODO: ReadString]
[+] Added ByteBufferPushReadState
[+] Added ByteBufferPushWriteState
[*] Move from USC-16 to full UTF-16. Win32 can handle full UTF-16.
[*] ELogLevel is now an Aurora enum
[+] Raised arbitrary limit in header to 255, the max filter buffer
[+] Explicit GZip support
[+] Explicit Zip support
[+] Added [some] compressors
et al
2022-02-17 00:11:40 +00:00
}
2024-03-11 21:05:03 +00:00
AUKN_SYM AuOptional < const AuString & > GetWritableAppdata ( )
2022-01-18 14:26:38 +00:00
{
2024-03-11 21:05:03 +00:00
return gGlobalWritableAppDirectory . size ( ) ?
gGlobalWritableAppDirectory :
AuOptional < const AuString & > { } ;
2022-01-18 14:26:38 +00:00
}
2024-03-11 21:05:03 +00:00
AUKN_SYM AuOptional < const AuString & > GetRootAppdata ( )
2022-01-18 14:26:38 +00:00
{
2024-03-11 21:05:03 +00:00
return gAdminWritableAppDirectory . size ( ) ?
gAdminWritableAppDirectory :
AuOptional < const AuString & > { } ;
2022-01-18 14:26:38 +00:00
}
2024-03-11 21:05:03 +00:00
AUKN_SYM AuOptional < const AuString & > GetUserProgramsFolder ( )
[*/+/-] MEGA COMMIT. ~2 weeks compressed.
The intention is to quickly improve and add util apis, enhance functionality given current demands, go back to the build pipeline, finish that, publish runtime tests, and then use what we have to go back to to linux support with a more stable api.
[+] AuMakeSharedArray
[+] Technet ArgvQuote
[+] Grug subsystem (UNIX signal thread async safe ipc + telemetry flusher + log flusher.)
[+] auEndianness -> Endian swap utils
[+] AuGet<N>(...)
[*] AUE_DEFINE conversion for
ECompresionType, EAnsiColor, EHashType, EStreamError, EHexDump
[+] ConsoleMessage ByteBuffer serialization
[+] CmdLine subsystem for parsing command line arguments and simple switch/flag checks
[*] Split logger from console subsystem
[+] StartupParameters -> A part of a clean up effort under Process
[*] Refactor SysErrors header + get caller hack
[+] Atomic APIs
[+] popcnt
[+] Ring Buffer sink
[+] Added more standard errors
Catch,
Submission,
LockError,
NoAccess,
ResourceMissing,
ResourceLocked,
MalformedData,
InSandboxContext,
ParseError
[+] Added ErrorCategorySet, ErrorCategoryClear, GetStackTrace
[+] IExitSubscriber, ETriggerLevel
[*] Write bias the high performance RWLockImpl read-lock operation operation
[+] ExitHandlerAdd/ExitHandlerRemove (exit subsystem)
[*] Updated API style
Digests
[+] CpuId::CpuBitCount
[+] GetUserProgramsFolder
[+] GetPackagePath
[*] Split IStreamReader with an inl file
[*] BlobWriter/BlobReader/BlobArbitraryReader can now take shared pointers to bytebuffers. default constructor allocates a new scalable bytebuffer
[+] ICharacterProvider
[+] ICharacterProviderEx
[+] IBufferedCharacterConsumer
[+] ProviderFromSharedString
[+] ProviderFromString
[+] BufferConsumerFromProvider
[*] Parse Subsystem uses character io bufferer
[*] Rewritten NT's high perf semaphore to use userland SRW/ConVars [like mutex, based on generic semaphore]
[+] ByteBuffer::ResetReadPointer
[*] Bug fix bytebuffer base not reset on free and some scaling issues
[+] ProcessMap -> Added kSectionNameStack, kSectionNameFile, kSectionNameHeap for Section
[*] ProcessMap -> Refactor Segment to Section. I was stupid for keeping a type conflict hack API facing
[+] Added 64 *byte* fast RNG seeds
[+] File Advisorys/File Lock Awareness
[+] Added extended IAuroraThread from OS identifier caches for debug purposes
[*] Tweaked how memory is reported on Windows. Better consistency of what values mean across functions.
[*] Broke AuroraUtils/Typedefs out into a separate library
[*] Update build script
[+] Put some more effort into adding detail to the readme before rewriting it, plus, added some media
[*] Improved public API documentation
[*] Bug fix `SetConsoleCtrlHandler`
[+] Locale TimeDateToFileNameISO8601
[+] Console config stdOutShortTime
[*] Begin using internal UTF8/16 decoders when platform support isnt available (instead of stl)
[*] Bug fixes in decoders
[*] Major bug fix, AuMax
[+] RateLimiter
[+] Binary file sink
[+] Log directory sink
[*] Data header usability (more operators)
[+] AuRemoveRange
[+] AuRemove
[+] AuTryRemove
[+] AuTryRemoveRange
[+] auCastUtils
[+] Finish NewLSWin32Source
[+] AuTryFindByTupleN, AuTryRemoveByTupleN
[+] Separated AuRead/Write types, now in auTypeUtils
[+] Added GetPosition/SetPosition to FileWriter
[*] Fix stupid AuMin in place of AuMax in SpawnThread.Unix.Cpp
[*] Refactored Arbitrary readers to SeekingReaders (as in, they could be atomic and/or parallelized, and accept an arbitrary position as a work parameter -> not Seekable, as in, you can simply set the position)
[*] Hack back in the sched deinit
[+] File AIO loop source interop
[+] Begin to prototype a LoopQueue object I had in mind for NT, untested btw
[+] Stub code for networking
[+] Compression BaseStream/IngestableStreamBase
[*] Major: read/write locks now support write-entrant read routines.
[*] Compression subsystem now uses the MemoryView concept
[*] Rewrite the base stream compressions, made them less broken
[*] Update hashing api
[*] WriterTryGoForward and ReaderTryGoForward now revert to the previous relative index instead of panicing
[+] Added new AuByteBuffer apis
Trim, Pad, WriteFrom, WriteString, [TODO: ReadString]
[+] Added ByteBufferPushReadState
[+] Added ByteBufferPushWriteState
[*] Move from USC-16 to full UTF-16. Win32 can handle full UTF-16.
[*] ELogLevel is now an Aurora enum
[+] Raised arbitrary limit in header to 255, the max filter buffer
[+] Explicit GZip support
[+] Explicit Zip support
[+] Added [some] compressors
et al
2022-02-17 00:11:40 +00:00
{
2024-03-11 21:05:03 +00:00
return gProgramsFolder . size ( ) ?
gProgramsFolder :
AuOptional < const AuString & > { } ;
[*/+/-] MEGA COMMIT. ~2 weeks compressed.
The intention is to quickly improve and add util apis, enhance functionality given current demands, go back to the build pipeline, finish that, publish runtime tests, and then use what we have to go back to to linux support with a more stable api.
[+] AuMakeSharedArray
[+] Technet ArgvQuote
[+] Grug subsystem (UNIX signal thread async safe ipc + telemetry flusher + log flusher.)
[+] auEndianness -> Endian swap utils
[+] AuGet<N>(...)
[*] AUE_DEFINE conversion for
ECompresionType, EAnsiColor, EHashType, EStreamError, EHexDump
[+] ConsoleMessage ByteBuffer serialization
[+] CmdLine subsystem for parsing command line arguments and simple switch/flag checks
[*] Split logger from console subsystem
[+] StartupParameters -> A part of a clean up effort under Process
[*] Refactor SysErrors header + get caller hack
[+] Atomic APIs
[+] popcnt
[+] Ring Buffer sink
[+] Added more standard errors
Catch,
Submission,
LockError,
NoAccess,
ResourceMissing,
ResourceLocked,
MalformedData,
InSandboxContext,
ParseError
[+] Added ErrorCategorySet, ErrorCategoryClear, GetStackTrace
[+] IExitSubscriber, ETriggerLevel
[*] Write bias the high performance RWLockImpl read-lock operation operation
[+] ExitHandlerAdd/ExitHandlerRemove (exit subsystem)
[*] Updated API style
Digests
[+] CpuId::CpuBitCount
[+] GetUserProgramsFolder
[+] GetPackagePath
[*] Split IStreamReader with an inl file
[*] BlobWriter/BlobReader/BlobArbitraryReader can now take shared pointers to bytebuffers. default constructor allocates a new scalable bytebuffer
[+] ICharacterProvider
[+] ICharacterProviderEx
[+] IBufferedCharacterConsumer
[+] ProviderFromSharedString
[+] ProviderFromString
[+] BufferConsumerFromProvider
[*] Parse Subsystem uses character io bufferer
[*] Rewritten NT's high perf semaphore to use userland SRW/ConVars [like mutex, based on generic semaphore]
[+] ByteBuffer::ResetReadPointer
[*] Bug fix bytebuffer base not reset on free and some scaling issues
[+] ProcessMap -> Added kSectionNameStack, kSectionNameFile, kSectionNameHeap for Section
[*] ProcessMap -> Refactor Segment to Section. I was stupid for keeping a type conflict hack API facing
[+] Added 64 *byte* fast RNG seeds
[+] File Advisorys/File Lock Awareness
[+] Added extended IAuroraThread from OS identifier caches for debug purposes
[*] Tweaked how memory is reported on Windows. Better consistency of what values mean across functions.
[*] Broke AuroraUtils/Typedefs out into a separate library
[*] Update build script
[+] Put some more effort into adding detail to the readme before rewriting it, plus, added some media
[*] Improved public API documentation
[*] Bug fix `SetConsoleCtrlHandler`
[+] Locale TimeDateToFileNameISO8601
[+] Console config stdOutShortTime
[*] Begin using internal UTF8/16 decoders when platform support isnt available (instead of stl)
[*] Bug fixes in decoders
[*] Major bug fix, AuMax
[+] RateLimiter
[+] Binary file sink
[+] Log directory sink
[*] Data header usability (more operators)
[+] AuRemoveRange
[+] AuRemove
[+] AuTryRemove
[+] AuTryRemoveRange
[+] auCastUtils
[+] Finish NewLSWin32Source
[+] AuTryFindByTupleN, AuTryRemoveByTupleN
[+] Separated AuRead/Write types, now in auTypeUtils
[+] Added GetPosition/SetPosition to FileWriter
[*] Fix stupid AuMin in place of AuMax in SpawnThread.Unix.Cpp
[*] Refactored Arbitrary readers to SeekingReaders (as in, they could be atomic and/or parallelized, and accept an arbitrary position as a work parameter -> not Seekable, as in, you can simply set the position)
[*] Hack back in the sched deinit
[+] File AIO loop source interop
[+] Begin to prototype a LoopQueue object I had in mind for NT, untested btw
[+] Stub code for networking
[+] Compression BaseStream/IngestableStreamBase
[*] Major: read/write locks now support write-entrant read routines.
[*] Compression subsystem now uses the MemoryView concept
[*] Rewrite the base stream compressions, made them less broken
[*] Update hashing api
[*] WriterTryGoForward and ReaderTryGoForward now revert to the previous relative index instead of panicing
[+] Added new AuByteBuffer apis
Trim, Pad, WriteFrom, WriteString, [TODO: ReadString]
[+] Added ByteBufferPushReadState
[+] Added ByteBufferPushWriteState
[*] Move from USC-16 to full UTF-16. Win32 can handle full UTF-16.
[*] ELogLevel is now an Aurora enum
[+] Raised arbitrary limit in header to 255, the max filter buffer
[+] Explicit GZip support
[+] Explicit Zip support
[+] Added [some] compressors
et al
2022-02-17 00:11:40 +00:00
}
2024-03-10 15:00:13 +00:00
AUKN_SYM AuOptional < AuString > NewTempFile ( )
{
AuString path ;
path = gTempDir ;
if ( path . empty ( ) )
{
SysPushErrorUninitialized ( ) ;
return { } ;
}
2024-03-11 17:14:59 +00:00
path + = fmt : : format ( " TempFile_{} " , AuRNG : : ReadString ( 64 , AuRNG : : ERngStringCharacters : : eAlphaNumericCharacters ) ) ;
2024-03-10 15:00:13 +00:00
if ( ! AuFS : : WriteNewFile ( path , { } ) )
{
SysPushErrorIO ( ) ;
return { } ;
}
auto normalizedPath = AuFS : : NormalizePathRet ( path ) ;
# if defined(AURORA_PLATFORM_WIN32)
auto widePath = AuLocale : : ConvertFromUTF8 ( normalizedPath ) ;
MoveFileExW ( widePath . c_str ( ) , nullptr , MOVEFILE_DELAY_UNTIL_REBOOT ) ;
# endif
return normalizedPath ;
}
AUKN_SYM AuOptional < AuString > NewTempDirectory ( )
{
AuString path ;
path = gTempDir ;
if ( path . empty ( ) )
{
SysPushErrorUninitialized ( ) ;
return { } ;
}
2024-03-11 17:14:59 +00:00
path + = fmt : : format ( " TempDirectory_{} " , AuRNG : : ReadString ( 32 , AuRNG : : ERngStringCharacters : : eAlphaNumericCharacters ) ) ;
2024-03-10 15:00:13 +00:00
if ( ! _MkDir ( path ) )
{
SysPushErrorIO ( ) ;
return { } ;
}
auto normalizedPath = AuFS : : NormalizePathRet ( path ) ;
# if defined(AURORA_PLATFORM_WIN32)
auto widePath = AuLocale : : ConvertFromUTF8 ( normalizedPath ) ;
MoveFileExW ( widePath . c_str ( ) , nullptr , MOVEFILE_DELAY_UNTIL_REBOOT ) ;
# endif
return normalizedPath + AuString ( 1 , kPathSplitter ) ;
}
2021-12-24 15:44:51 +00:00
# if defined(AURORA_PLATFORM_WIN32)
2022-01-19 17:08:13 +00:00
static void Win32FixGlobalAppDataAcl ( const AuString & path )
2021-12-24 15:44:51 +00:00
{
BOOL bRetval = FALSE ;
HANDLE hToken = NULL ;
PSID pSIDEveryone = NULL ;
PACL pACL = NULL ;
SID_IDENTIFIER_AUTHORITY SIDAuthWorld =
SECURITY_WORLD_SID_AUTHORITY ;
const int NUM_ACES = 1 ;
2023-10-11 01:13:49 +00:00
EXPLICIT_ACCESS_A ea [ NUM_ACES ] ;
2021-12-24 15:44:51 +00:00
DWORD dwRes ;
2023-10-11 01:13:49 +00:00
if ( ! pAllocateAndInitializeSid )
{
SysPushErrorFIO ( " AllocateAndInitializeSid (Everyone) error " ) ;
goto Cleanup ;
}
2021-12-24 15:44:51 +00:00
// Specify the DACL to use.
// Create a SID for the Everyone group.
2023-10-11 01:13:49 +00:00
if ( ! pAllocateAndInitializeSid ( & SIDAuthWorld , 1 ,
SECURITY_WORLD_RID ,
0 ,
0 , 0 , 0 , 0 , 0 , 0 ,
& pSIDEveryone ) )
2021-12-24 15:44:51 +00:00
{
SysPushErrorFIO ( " AllocateAndInitializeSid (Everyone) error " ) ;
goto Cleanup ;
}
2023-10-11 01:13:49 +00:00
ZeroMemory ( & ea , NUM_ACES * sizeof ( EXPLICIT_ACCESS_A ) ) ;
2021-12-24 15:44:51 +00:00
// Set read access for Everyone.
ea [ 0 ] . grfAccessPermissions = GENERIC_ALL ;
ea [ 0 ] . grfAccessMode = SET_ACCESS ;
ea [ 0 ] . grfInheritance = SUB_CONTAINERS_AND_OBJECTS_INHERIT ;
ea [ 0 ] . Trustee . TrusteeForm = TRUSTEE_IS_SID ;
ea [ 0 ] . Trustee . TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP ;
ea [ 0 ] . Trustee . ptstrName = ( LPTSTR ) pSIDEveryone ;
2023-10-11 01:13:49 +00:00
if ( ! pSetEntriesInAclA )
{
SysPushErrorFIO ( " Failed SetEntriesInAcl " ) ;
goto Cleanup ;
}
if ( ERROR_SUCCESS ! = pSetEntriesInAclA ( NUM_ACES ,
ea ,
NULL ,
& pACL ) )
2021-12-24 15:44:51 +00:00
{
SysPushErrorFIO ( " Failed SetEntriesInAcl " ) ;
goto Cleanup ;
}
2023-10-11 01:13:49 +00:00
if ( ! pSetNamedSecurityInfoW )
{
SysPushErrorFIO ( " Failed SetNamedSecurityInfoW " ) ;
goto Cleanup ;
}
2021-12-24 15:44:51 +00:00
// Try to modify the object's DACL.
2023-10-11 01:13:49 +00:00
dwRes = pSetNamedSecurityInfoW (
2022-01-19 02:49:44 +00:00
Locale : : ConvertFromUTF8 ( FS : : NormalizePathRet ( path ) ) . data ( ) , // name of the object
2021-12-24 15:44:51 +00:00
SE_FILE_OBJECT , // type of object
DACL_SECURITY_INFORMATION , // change only the object's DACL
NULL , NULL , // do not change owner or group
pACL , // DACL specified
NULL ) ; // do not change SACL
if ( ERROR_SUCCESS = = dwRes )
{
bRetval = TRUE ;
// No more processing needed.
goto Cleanup ;
}
if ( dwRes ! = ERROR_ACCESS_DENIED )
{
SysPushErrorFIO ( " First SetNamedSecurityInfo call failed: {} " , dwRes ) ;
goto Cleanup ;
}
Cleanup :
if ( pSIDEveryone )
2021-12-26 15:51:31 +00:00
{
2023-10-11 01:13:49 +00:00
if ( pFreeSid )
{
pFreeSid ( pSIDEveryone ) ;
}
2021-12-26 15:51:31 +00:00
}
2021-12-24 15:44:51 +00:00
if ( pACL )
2021-12-26 15:51:31 +00:00
{
LocalFree ( pACL ) ;
}
2021-12-24 15:44:51 +00:00
if ( hToken )
2021-12-26 15:51:31 +00:00
{
2023-10-11 01:13:49 +00:00
AuWin32CloseHandle ( hToken ) ;
2021-12-26 15:51:31 +00:00
}
2021-12-24 15:44:51 +00:00
if ( ! bRetval )
{
AuLogError ( " Couldn't grant ownership to EVERYONE; System wide configuration directory {} will be inaccessible to other users " , path ) ;
}
}
# endif
}