summaryrefslogtreecommitdiff
path: root/src/extsh.cpp
blob: 07a7d473fb9154afc50ed514b976f1a97dd9929b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "fs/extfs.hpp"

#include <iostream>
#include <string>

int main(int argc, char const * argv[])
  {
  auto const & path = [&]{ return std::string{argc > 1 ? argv[1] : "vdisk.img"}; }();
  auto const & disk = fs::extfs{path};

  if(disk.open())
    {
    std::clog << "[EXTSH] Successfully opened ext*fs at: '" << path << "'\n";
    if(disk.has_label())
      {
      std::clog << "[EXTSH] The filesystem is labeled '" << disk.label() << "'\n";
      }
    }
  else
    {
    std::clog << "[EXTSH] Failed to open ext*fs at: '" << path << "'\n";
    }
  }