6 |
|
|
7 |
|
#include <menes/standard.hh> |
8 |
|
|
9 |
– |
#include <menes-api/realpath.hpp> |
10 |
– |
|
9 |
|
#include "Share.hpp" |
10 |
|
|
11 |
|
Share::Share(const _H<dbi::Connection>& connection, const ext::String& host, const ext::String& share) : connection(connection), host(host), share(share) |
12 |
|
{ |
13 |
< |
api::Path shares(api::RealPath(_B("Shares"))); |
13 |
> |
api::Path shares(_B("Shares")); |
14 |
|
|
15 |
|
if (!shares.Exists()) |
16 |
< |
api::Posix::CheckError(::mkdir(shares.GetPath().NullTerminate(), 0755)); |
16 |
> |
shares.CreateDirectory(); |
17 |
|
|
18 |
< |
api::Path host_(shares.GetChild(host)); |
18 |
> |
api::Path host_(shares.GetRealPath().GetChild(host)); |
19 |
|
|
20 |
|
if (!host_.Exists()) |
21 |
< |
api::Posix::CheckError(::mkdir(host_.GetPath().NullTerminate(), 0755)); |
21 |
> |
host_.CreateDirectory(); |
22 |
|
|
23 |
|
path = host_.GetChild(share); |
24 |
|
|
25 |
|
if (!path.Exists()) |
26 |
< |
api::Posix::CheckError(::mkdir(path.GetPath().NullTerminate(), 0755)); |
26 |
> |
path.CreateDirectory(); |
27 |
|
} |
28 |
|
|
29 |
|
void Share::Mount() const |