Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
ac31b99f
Commit
ac31b99f
authored
25 years ago
by
Fredrik Noring
Browse files
Options
Downloads
Patches
Plain Diff
Now closing and reopening during file moves (a NT problem).
Rev: lib/modules/Yabu.pmod/module.pmod:1.13
parent
57f4e15b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/modules/Yabu.pmod/module.pmod
+19
-4
19 additions, 4 deletions
lib/modules/Yabu.pmod/module.pmod
with
19 additions
and
4 deletions
lib/modules/Yabu.pmod/module.pmod
+
19
−
4
View file @
ac31b99f
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
* associated with a unique key.
* associated with a unique key.
*/
*/
constant cvs_id = "$Id: module.pmod,v 1.1
2
1999/08/
06 23:08:14 hubbe
Exp $";
constant cvs_id = "$Id: module.pmod,v 1.1
3
1999/08/
25 14:24:29 noring
Exp $";
#define ERR(msg) throw(({ "(Yabu) "+msg+"\n", backtrace() }))
#define ERR(msg) throw(({ "(Yabu) "+msg+"\n", backtrace() }))
#define IO_ERR(msg) throw(({ sprintf("(Yabu) %s, %s (%d)\n",msg,strerror(errno()),errno()),backtrace() }))
#define IO_ERR(msg) throw(({ sprintf("(Yabu) %s, %s (%d)\n",msg,strerror(errno()),errno()),backtrace() }))
...
@@ -127,6 +127,7 @@ class YabuLog {
...
@@ -127,6 +127,7 @@ class YabuLog {
static private class FileIO {
static private class FileIO {
INHERIT_MUTEX
INHERIT_MUTEX
static private inherit Stdio.File:file;
static private inherit Stdio.File:file;
static private string filemode;
static private void seek(int offset)
static private void seek(int offset)
{
{
...
@@ -165,12 +166,24 @@ static private class FileIO {
...
@@ -165,12 +166,24 @@ static private class FileIO {
UNLOCK();
UNLOCK();
}
}
void
create(string filename, string mode
)
void
file_close(
)
{
{
file::create();
file::close();
if(!file::open(filename, mode))
}
void file_open(string filename)
{
if(!file::open(filename, filemode))
ERR(strerror(file::errno()));
ERR(strerror(file::errno()));
}
}
void create(string filename, string _filemode)
{
file::create();
filemode = _filemode;
file_open(filename);
}
}
}
...
@@ -454,9 +467,11 @@ class Chunk {
...
@@ -454,9 +467,11 @@ class Chunk {
LOCK();
LOCK();
if(!write)
if(!write)
ERR("Cannot move in read mode");
ERR("Cannot move in read mode");
file_close();
if(!mv(filename, new_filename))
if(!mv(filename, new_filename))
IO_ERR("Move failed");
IO_ERR("Move failed");
filename = new_filename;
filename = new_filename;
file_open(filename);
UNLOCK();
UNLOCK();
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment