Skip to content

Commit 64c24be

Browse files
committed
Changed the posix fileExists -> fopen call.
1 parent 4f00d4b commit 64c24be

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"keywords": [
66
"pdf", "forms", "poppler", "qt4", "cairo"
77
],
8-
"version": "0.1.2",
8+
"version": "0.1.3",
99
"repository": {
1010
"type": "git",
1111
"url": "git://github.com/tpisto/pdf-fill-form.git"

src/NodePoppler.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ using v8::Array;
2727
using v8::Value;
2828

2929
inline bool fileExists (const std::string& name) {
30-
return ( access( name.c_str(), F_OK ) != -1 );
30+
if (FILE *file = fopen(name.c_str(), "r")) {
31+
fclose(file);
32+
return true;
33+
} else {
34+
return false;
35+
}
3136
}
3237

3338
// Cairo write and read functions (to QBuffer)

0 commit comments

Comments
 (0)