Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
bb58829f
Commit
bb58829f
authored
Jul 28, 1999
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only open temp file if not in read-only mode.
parent
27eb6c44
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
src/ZODB/FileStorage.py
src/ZODB/FileStorage.py
+8
-3
No files found.
src/ZODB/FileStorage.py
View file @
bb58829f
...
@@ -184,7 +184,7 @@
...
@@ -184,7 +184,7 @@
# may have a back pointer to a version record or to a non-version
# may have a back pointer to a version record or to a non-version
# record.
# record.
#
#
__version__
=
'$Revision: 1.
19
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
20
$'
[
11
:
-
2
]
import
struct
,
time
,
os
,
bpthread
,
string
,
base64
import
struct
,
time
,
os
,
bpthread
,
string
,
base64
from
struct
import
pack
,
unpack
from
struct
import
pack
,
unpack
...
@@ -242,7 +242,7 @@ class FileStorage(BaseStorage.BaseStorage):
...
@@ -242,7 +242,7 @@ class FileStorage(BaseStorage.BaseStorage):
if
stop
is
None
:
stop
=
'
\
377
'
*
8
if
stop
is
None
:
stop
=
'
\
377
'
*
8
# Lock the database
# Lock the database
and set up the temp file.
if
not
read_only
:
if
not
read_only
:
try
:
f
=
open
(
file_name
+
'.lock'
,
'r+'
)
try
:
f
=
open
(
file_name
+
'.lock'
,
'r+'
)
except
:
f
=
open
(
file_name
+
'.lock'
,
'w+'
)
except
:
f
=
open
(
file_name
+
'.lock'
,
'w+'
)
...
@@ -253,9 +253,14 @@ class FileStorage(BaseStorage.BaseStorage):
...
@@ -253,9 +253,14 @@ class FileStorage(BaseStorage.BaseStorage):
except
:
pass
except
:
pass
self
.
_lock_file
=
f
# so it stays open
self
.
_lock_file
=
f
# so it stays open
self
.
_tfile
=
open
(
file_name
+
'.tmp'
,
'w+b'
)
else
:
self
.
_tfile
=
None
BaseStorage
.
BaseStorage
.
__init__
(
self
,
file_name
)
BaseStorage
.
BaseStorage
.
__init__
(
self
,
file_name
)
self
.
_tfile
=
open
(
file_name
+
'.tmp'
,
'w+b'
)
index
,
vindex
,
tindex
,
tvindex
=
self
.
_newIndexes
()
index
,
vindex
,
tindex
,
tvindex
=
self
.
_newIndexes
()
self
.
_initIndex
(
index
,
vindex
,
tindex
,
tvindex
)
self
.
_initIndex
(
index
,
vindex
,
tindex
,
tvindex
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment