blob: 1546050e9b845d3ac6e4163a038bfc1156613cda [file] [log] [blame]
Brian Silverman41cdd3e2019-01-19 19:48:58 -08001/*----------------------------------------------------------------------------*/
2/* Copyright (c) 2018 FIRST. All Rights Reserved. */
3/* Open Source Software - may be modified and shared by FRC teams. The code */
4/* must be accompanied by the FIRST BSD license file in the root directory of */
5/* the project. */
6/*----------------------------------------------------------------------------*/
7
8#include "frc/Filesystem.h"
9
10#include <wpi/FileSystem.h>
11#include <wpi/Path.h>
12
13#include "frc/RobotBase.h"
14
15void frc::filesystem::GetLaunchDirectory(wpi::SmallVectorImpl<char>& result) {
16 wpi::sys::fs::current_path(result);
17}
18
19void frc::filesystem::GetOperatingDirectory(
20 wpi::SmallVectorImpl<char>& result) {
21 if (RobotBase::IsReal()) {
22 wpi::sys::path::native("/home/lvuser", result);
23 } else {
24 frc::filesystem::GetLaunchDirectory(result);
25 }
26}
27
28void frc::filesystem::GetDeployDirectory(wpi::SmallVectorImpl<char>& result) {
29 frc::filesystem::GetOperatingDirectory(result);
30 wpi::sys::path::append(result, "deploy");
31}