On 10 October 2010 14:24, Zenaan Harkness zen...@gmail.com wrote:
On Sun, Oct 10, 2010 at 2:13 PM, Adrian Chadd adr...@creative.net.au wrote:
The horrible, O(n) way is to just to loop over 0 .. n, see if it doesn't
exist, if it doesn't then create and use it.
It's slow, it's racy (ie, don't
On Sun, Oct 10, 2010 at 09:52:19AM +1100, Zenaan Harkness wrote:
How about just using symlinks instead.
eg
# creation
UNIQUE_NAME=unique_login_name
MY_LOOP_DEV=/dev/loop/$UNIQUE_NAME
# Setup loop device and grab it's name
LOOP_DEV=`sudo losetup --show --find /home/$UNIQUE_NAME/source`
#
Great!
I was unfamiliar with readlink's ability. That'll work well.
Thanks
Zen
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
On Sun, Oct 10, 2010 at 11:27 AM, John Ferlito jo...@inodes.org wrote:
How about just using symlinks instead.
eg
# creation
UNIQUE_NAME=unique_login_name
MY_LOOP_DEV=/dev/loop/$UNIQUE_NAME
# Setup loop device and grab it's name
LOOP_DEV=`sudo losetup --show --find
The horrible, O(n) way is to just to loop over 0 .. n, see if it doesn't
exist, if it doesn't then create and use it.
It's slow, it's racy (ie, don't run the script without locking :-) but
it's a traditional UNIX way of doing things.
PTYs were once allocated that way, fe. :-)
Adrian
On Sun,
On Sun, Oct 10, 2010 at 2:13 PM, Adrian Chadd adr...@creative.net.au wrote:
The horrible, O(n) way is to just to loop over 0 .. n, see if it doesn't
exist, if it doesn't then create and use it.
It's slow, it's racy (ie, don't run the script without locking :-) but
it's a traditional UNIX way
On Sun, Oct 10, 2010, Zenaan Harkness wrote:
On Sun, Oct 10, 2010 at 2:13 PM, Adrian Chadd adr...@creative.net.au wrote:
The horrible, O(n) way is to just to loop over 0 .. n, see if it doesn't
exist, if it doesn't then create and use it.
It's slow, it's racy (ie, don't run the script