You could always just wrap your app around this:
#!/usr/bin/perl -w
use Fcntl ':flock';
flock(DATA, LOCK_EX|LOCK_NB) or die "Another copy is running!";
system(@ARGV);
__DATA__
Don't delete this part.
Save that as my_wrapper, and call with `my_wrapper node my_app.js`
Matt.
On Wed, Mar 28, 2012 at 3:56 AM, Joran Greef <[email protected]> wrote:
> Thanks Ben, Matt. I'm on Ubuntu and Mac. Will try the "x" flag. Need to
> ensure that only one process is running at a time.
>
>
> On Tuesday, March 27, 2012 2:26:27 PM UTC+2, Matt Sergeant wrote:
>>
>> None from my end (aside from what's already in fs-ext). What platform are
>> you on?
>>
>> FWIW you can get around the need for flock in a lot of situations by
>> using the new "x" flag when opening a file. But it depends what you need to
>> do.
>>
>> On Tue, Mar 27, 2012 at 3:46 AM, Joran Greef <[email protected]> wrote:
>>
>>> Could really use flock right now, any progress on this?
>>>
>>>
>>> On Friday, September 2, 2011 10:29:29 PM UTC+2, Matt Sergeant wrote:
>>>>
>>>> On Fri, Sep 2, 2011 at 4:05 PM, Ryan Dahl <[email protected]> wrote:
>>>>
>>>>> > I do also think that even if this is just a basic call to
>>>>> > flock/lockf/LockFileEx then the docs or FAQ can just say "Sorry your
>>>>> OS
>>>>> > implementation of flock() sucks - patches welcome".
>>>>> > Matt.
>>>>>
>>>>> A file locking API would be welcome. It belongs in libuv and needs to
>>>>> support Solaris and Windows out of the box.
>>>>>
>>>>
>>>> OK, if I get chance this holiday weekend I'll have a look at migrating
>>>> it into libuv, and making it use fcntl where flock isn't available. No
>>>> guarantees though - have a few plans already this w/e.
>>>>
>>>
>>