MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / InstallFileSystems

Method InstallFileSystems

Engine/source/platformPOSIX/posixVolume.cpp:597–619  ·  view source on GitHub ↗

Function invoked by the kernel layer to install OS specific file systems.

Source from the content-addressed store, hash-verified

595/// Function invoked by the kernel layer to install OS specific
596/// file systems.
597bool Platform::FS::InstallFileSystems()
598{
599#ifndef TORQUE_SECURE_VFS
600 Platform::FS::Mount( "/", Platform::FS::createNativeFS( String() ) );
601
602 // Setup the current working dir.
603 char buffer[PATH_MAX];
604 if (::getcwd(buffer,sizeof(buffer)))
605 {
606 // add trailing '/' if it isn't there
607 if (buffer[dStrlen(buffer) - 1] != '/')
608 dStrcat(buffer, "/", PATH_MAX);
609
610 Platform::FS::SetCwd(buffer);
611 }
612
613 // Mount the home directory
614 if (char* home = getenv("HOME"))
615 Platform::FS::Mount( "home", Platform::FS::createNativeFS(home) );
616#endif
617
618 return true;
619}

Callers

nothing calls this directly

Calls 6

MountFunction · 0.85
dStrcatFunction · 0.85
SetCwdFunction · 0.85
getenvFunction · 0.85
StringClass · 0.50
dStrlenFunction · 0.50

Tested by

no test coverage detected