Skip to content

Commit

Permalink
Changed the posix fileExists -> fopen call.
Browse files Browse the repository at this point in the history
  • Loading branch information
tpisto committed Apr 14, 2015
1 parent 4f00d4b commit 64c24be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"keywords": [
"pdf", "forms", "poppler", "qt4", "cairo"
],
"version": "0.1.2",
"version": "0.1.3",
"repository": {
"type": "git",
"url": "git://github.com/tpisto/pdf-fill-form.git"
Expand Down
7 changes: 6 additions & 1 deletion src/NodePoppler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ using v8::Array;
using v8::Value;

inline bool fileExists (const std::string& name) {
return ( access( name.c_str(), F_OK ) != -1 );
if (FILE *file = fopen(name.c_str(), "r")) {
fclose(file);
return true;
} else {
return false;
}
}

// Cairo write and read functions (to QBuffer)
Expand Down

0 comments on commit 64c24be

Please sign in to comment.