Skip to content

Commit

Permalink
sl: fix #52
Browse files Browse the repository at this point in the history
  • Loading branch information
joannajarmulska committed Jun 2, 2016
1 parent 776f96a commit 841b82e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libraries/qsl/sl.q
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,9 @@
if[`FILE in out;
.log.p.h:hopen .log.p.path:.log.p.insertTs[.log.path;cid];
if[(string .z.o) like "l*";
system "ln -f -s ",((1+count string hsym .log.path)_string .log.p.path)," ",1_(string hsym .log.path),"/init.log";
system "ln -f -s ",((1+count string hsym .log.path)_string .log.p.path)," ",1_(string hsym .log.path),"/current.log"
.log.p.initLog:((1+count string hsym .log.path)_string .log.p.path);
system "ln -f -s ",.log.p.initLog," ",.log.p.initLogLink:1_(string hsym .log.path),"/init.log";
system "ln -f -s ",.log.p.initLog," ",1_(string hsym .log.path),"/current.log"
];
if[not .log.rotate~0Nt;
.sl.lib["qsl/timer"];
Expand Down Expand Up @@ -408,6 +409,9 @@
//(neg .log.p.h) (string value .log.p.time)[.log.p.pattern], " log continued from ", 1_string prevpath;
.log.info[`sl] " log continued from ", 1_string prevpath;
if[(string .z.o) like "l*";
system "touch ",.log.p.initLogLink; // touch the log file
system "rm -f ",.log.p.initLogLink; // remove the link. Some systems don't support touch -h
system "ln -f -s ",.log.p.initLog," ",.log.p.initLogLink; // put the link back
system "ln -f -s ",((1+count string hsym .log.path)_string .log.p.path)," ",1_(string hsym .log.path),"/current.log"
];
};
Expand Down

0 comments on commit 841b82e

Please sign in to comment.