Skip to content

Commit

Permalink
quantize: don't use std::filesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
abb128 committed Jan 27, 2025
1 parent 662b336 commit 010c787
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/tools/quantize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@
#include <map>
#include <string>
#include <vector>
#include <filesystem>

bool file_exists(const char* filename) {
FILE* file = fopen(filename, "r");
if (file) {
fclose(file);
return true;
}
return false;
}

bool ends_with(const std::string &a, const std::string &b) {
if (b.length() > a.length()) {
Expand Down Expand Up @@ -218,7 +226,7 @@ int main(int argc, char ** argv) {
std::string out_filename = argv[2];
std::string quant_typename = argv[3];

if(!std::filesystem::exists(src_filename)) {
if(!file_exists(src_filename.c_str())) {
printf("file %s not found\n", src_filename.c_str());
return 1;
}
Expand Down

0 comments on commit 010c787

Please sign in to comment.