mirror of
https://github.com/TomHarte/CLK.git
synced 2024-10-01 13:58:20 +00:00
24 lines
421 B
C++
24 lines
421 B
C++
|
//
|
||
|
// FileHolder.cpp
|
||
|
// Clock Signal
|
||
|
//
|
||
|
// Created by Thomas Harte on 21/11/2016.
|
||
|
// Copyright © 2016 Thomas Harte. All rights reserved.
|
||
|
//
|
||
|
|
||
|
#include "FileHolder.hpp"
|
||
|
|
||
|
using namespace Storage;
|
||
|
|
||
|
FileHolder::~FileHolder()
|
||
|
{
|
||
|
if(file_) fclose(file_);
|
||
|
}
|
||
|
|
||
|
FileHolder::FileHolder(const char *file_name) : file_(nullptr)
|
||
|
{
|
||
|
stat(file_name, &file_stats_);
|
||
|
file_ = fopen(file_name, "rb");
|
||
|
if(!file_) throw ErrorCantOpen;
|
||
|
}
|