Determine if only one instance is running: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: order of arguments has changed) |
|||
Line 751: | Line 751: | ||
sleep 60; # then your code goes here</lang> |
sleep 60; # then your code goes here</lang> |
||
=={{header|Perl 6}}== |
=={{header|Perl 6}}== |
||
{{works with|rakudo| |
{{works with|rakudo|2018.03}} |
||
An old-school Unix solution, none the worse for the wear: |
An old-school Unix solution, none the worse for the wear: |
||
<lang perl6>my $name = $*PROGRAM-NAME; |
<lang perl6>my $name = $*PROGRAM-NAME; |
||
Line 770: | Line 770: | ||
$pidfile.close; |
$pidfile.close; |
||
if try link($ |
if try link($lockpid, $lockfile) { |
||
$havelock = True; |
$havelock = True; |
||
} |
} |