Skip to content

WinCE has no current directory #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/boost/filesystem/path.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,8 @@ namespace filesystem
bool is_relative() const { return !is_absolute(); }
bool is_absolute() const
{
# ifdef BOOST_WINDOWS_API
// Windows CE has no root name (aka driver letters)
# if defined(BOOST_WINDOWS_API) && !defined(UNDER_CE)
return has_root_name() && has_root_directory();
# else
return has_root_directory();
Expand Down
8 changes: 8 additions & 0 deletions src/operations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,9 @@ namespace detail
}
return cur;

# elif defined(UNDER_CE)
// Windows CE has no current directory, so everything's relative to the root of the directory tree
return L"\\";
# else
DWORD sz;
if ((sz = ::GetCurrentDirectoryW(0, NULL)) == 0)sz = 1;
Expand All @@ -1115,8 +1118,13 @@ namespace detail
BOOST_FILESYSTEM_DECL
void current_path(const path& p, system::error_code* ec)
{
# ifdef UNDER_CE
error(BOOST_ERROR_NOT_SUPPORTED, p, ec,
"boost::filesystem::current_path");
# else
error(!BOOST_SET_CURRENT_DIRECTORY(p.c_str()) ? BOOST_ERRNO : 0,
p, ec, "boost::filesystem::current_path");
# endif
}

BOOST_FILESYSTEM_DECL
Expand Down