Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
why3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
126
Issues
126
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Why3
why3
Commits
3d12b47d
Commit
3d12b47d
authored
Nov 17, 2011
by
Andrei Paskevich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove a old backup before creating a new one
parent
910227ca
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
7 deletions
+15
-7
src/driver/whyconf.ml
src/driver/whyconf.ml
+2
-2
src/ide/session.ml
src/ide/session.ml
+3
-5
src/util/sysutil.ml
src/util/sysutil.ml
+7
-0
src/util/sysutil.mli
src/util/sysutil.mli
+3
-0
No files found.
src/driver/whyconf.ml
View file @
3d12b47d
...
...
@@ -28,7 +28,7 @@ open Rc
- 5 cvc3 native
- 6 driver renaming
- 7 yices native (used for release 0.70)
- 8 for release 0.71
- 8 for release 0.71
If a configuration doesn't contain the actual magic number we don't use it.*)
...
...
@@ -247,7 +247,7 @@ let read_config conf_file =
let
save_config
config
=
let
filename
=
config
.
conf_file
in
if
Sys
.
file_exists
filename
then
Sys
.
rename
filename
(
filename
^
".bak"
)
;
Sysutil
.
backup_file
filename
;
to_file
filename
config
.
config
let
get_main
config
=
config
.
main
...
...
src/ide/session.ml
View file @
3d12b47d
...
...
@@ -610,6 +610,8 @@ let schedule_edit_proof ~debug:_ ~editor ~file ~driver ~callback goal =
then
begin
let
backup
=
file
^
".bak"
in
if
Sys
.
file_exists
backup
then
Sys
.
remove
backup
;
Sys
.
rename
file
backup
;
Some
(
open_in
backup
)
end
...
...
@@ -1537,11 +1539,7 @@ let save_session () =
match
!
current_env
with
|
Some
_
->
let
f
=
Filename
.
concat
!
project_dir
db_filename
in
begin
if
Sys
.
file_exists
f
then
let
b
=
f
^
".bak"
in
if
Sys
.
file_exists
b
then
Sys
.
remove
b
;
Sys
.
rename
f
b
end
;
Sysutil
.
backup_file
f
;
save
f
|
None
->
eprintf
"Session.save_session: no session opened@."
;
...
...
src/util/sysutil.ml
View file @
3d12b47d
...
...
@@ -17,6 +17,13 @@
(* *)
(**************************************************************************)
let
backup_file
f
=
if
Sys
.
file_exists
f
then
begin
let
fb
=
f
^
".bak"
in
if
Sys
.
file_exists
fb
then
Sys
.
remove
fb
;
Sys
.
rename
f
fb
end
let
channel_contents_fmt
cin
fmt
=
let
buff
=
String
.
make
1024
'
'
in
let
n
=
ref
0
in
...
...
src/util/sysutil.mli
View file @
3d12b47d
...
...
@@ -17,6 +17,9 @@
(* *)
(**************************************************************************)
(* create a backup copy of a file if it exists *)
val
backup_file
:
string
->
unit
(* return the content of an in-channel *)
val
channel_contents
:
in_channel
->
string
...
...
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