Function invoked by the kernel layer to install OS specific file systems.
| 595 | /// Function invoked by the kernel layer to install OS specific |
| 596 | /// file systems. |
| 597 | bool 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 | } |