Tuesday, April 9, 2019

Find first available object with number suffix

Sometimes you need to find a first available "something" with number.  For example you have a naming conventions for volumes like "prefix" + number ("myvolume002" for example).

So you probably want to find the next available.  Usually you probably use the incremental naming procedure (http://www.wfaguy.com/2016/12/incremental-naming.html)

That works great.  But sometimes objects (like volumes) get removed and then you get gaps.  Some customers don't like that and want to refill those gaps.