1 /* xbt_os_file.cpp -- portable interface to file-related functions */
3 /* Copyright (c) 2017. The SimGrid Team.
4 * All rights reserved. */
6 /* This program is free software; you can redistribute it and/or modify it
7 * under the terms of the license (GNU LGPL) which comes with this package. */
9 #include "xbt/file.hpp" /* this module */
16 #include <libgen.h> /* POSIX dirname */
18 std::string simgrid::xbt::Path::getDirname()
21 char *res = dirname(&p[0]);
22 return std::string(res, strlen(res));
25 std::string simgrid::xbt::Path::getBasename()
28 char *res = basename(&p[0]);
29 return std::string(res, strlen(res));