Is there a Smalltalk way to lock a file?
Hi guys, Do we have a method to lock a file at the OS level? I searched in image but I cannot find anything. If it would work in gemstone too that would be nice. Thanks! -- Mariano http://marianopeck.wordpress.com
Not aware of a way to do it directly... If you can do it from the shell, then System class>>performOnServer: will be your friend:) Dale On Thu, Mar 13, 2014 at 9:14 AM, Mariano Martinez Peck < marianopeck@gmail.com> wrote:
Hi guys,
Do we have a method to lock a file at the OS level? I searched in image but I cannot find anything. If it would work in gemstone too that would be nice.
Thanks!
-- Mariano http://marianopeck.wordpress.com
_______________________________________________ Glass mailing list Glass@lists.gemtalksystems.com http://lists.gemtalksystems.com/mailman/listinfo/glass
On Mar 13, 2014, at 1:14 PM, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
Hi guys,
Do we have a method to lock a file at the OS level? I searched in image but I cannot find anything.
We couldnât have done airflowing without that feature (which enables horizontal scaling). Take a look at: https://github.com/sebastianconcept/OmniBase The locking tests will fail in a default linux installation until you mount your filesystem with the mandatory locking option: http://www.hackinglinuxexposed.com/articles/20030623.html sebastian o/
Hi Mariano, It is supported directly in OSProcess. See the unit test for examples. Dave
Hi guys,
Do we have a method to lock a file at the OS level? I searched in image but I cannot find anything. If it would work in gemstone too that would be nice.
Thanks!
-- Mariano http://marianopeck.wordpress.com
Hi Mariano,
It is supported directly in OSProcess. See the unit test for examples.
Dave
Sorry, I should have been more clear about this. The classes in the OSProcess package are OSFileLock and OSFileRegionLock, as well as the methods in category 'file locking' of class UnixOSProcessAccessor. You can look at the unit tests to see how these are used, but you will not be able to actually run any of the tests that depend on #forkSqueak because these rely on a feature not present in Cog. So look at the tests as examples, but do not expect them to run. The actual file locking support should work fine on Pharo (but let me know if that is not true). HTH, Dave
Hi guys,
Do we have a method to lock a file at the OS level? I searched in image but I cannot find anything. If it would work in gemstone too that would be nice.
Thanks!
-- Mariano http://marianopeck.wordpress.com
participants (4)
-
Dale Henrichs -
David T. Lewis -
Mariano Martinez Peck -
Sebastian Sastre