Skip to content

Instantly share code, notes, and snippets.

@tokuhirom
Created March 26, 2013 03:20
Show Gist options
  • Save tokuhirom/5242866 to your computer and use it in GitHub Desktop.
Save tokuhirom/5242866 to your computer and use it in GitHub Desktop.
SQLite_File does not works on BSD-ish systems.
diff --git a/lib/SQLite_File.pm b/lib/SQLite_File.pm
index 90456a3..991ea40 100755
--- a/lib/SQLite_File.pm
+++ b/lib/SQLite_File.pm
@@ -282,7 +282,7 @@ sub TIEHASH {
}
else {
# if no file specified, use a temp file...
- ($fh, $file) = tempfile();
+ ($fh, $file) = tempfile(EXLOCK => 0);
# if keep not explicitly specified,
# remove the tempfile at destroy...
$keep = 0 if !defined $keep;
@@ -406,7 +406,7 @@ sub TIEARRAY {
}
else {
# if no file specified, use a temp file...
- ($fh, $file) = tempfile();
+ ($fh, $file) = tempfile(EXLOCK => 0);
# if keep not explicitly specified,
# remove the tempfile at destroy...
$keep = 0 if !defined $keep;
@majensen
Copy link

@tokuhirom wow, I just saw this. I appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment