Namespaces
Variants

std::experimental::filesystem:: space_info

From cppreference.net
헤더 파일에 정의됨 <experimental/filesystem>
struct space_info {

uintmax_t capacity ;
uintmax_t free ;
uintmax_t available ;

} ;
(filesystem TS)

space 에 의해 결정된 파일시스템 정보를 나타냅니다.

멤버들은 다음과 같은 의미를 가집니다:

  • capacity -- 파일시스템의 전체 크기(바이트 단위)
  • free -- 파일시스템의 여유 공간(바이트 단위)
  • available -- 비특권 프로세스가 사용 가능한 여유 공간( free 보다 같거나 적을 수 있음)

예제

#include <experimental/filesystem>
#include <iostream>
namespace fs = std::experimental::filesystem;
int main()
{
    fs::space_info devi = fs::space("/dev/null");
    fs::space_info tmpi = fs::space("/tmp");
    std::cout << "         Capacity         Free    Available\n"
              << "/dev:   " << devi.capacity << "   "
              << devi.free << "   " << devi.available << '\n'
              << "/tmp: " << tmpi.capacity << ' '
              << tmpi.free << ' ' << tmpi.available << '\n';
}

가능한 출력:

          Capacity         Free    Available
/dev:   4175114240   4175110144   4175110144
/tmp: 420651237376 411962273792 390570749952

참고 항목

파일 시스템에서 사용 가능한 여유 공간을 결정합니다
(function)