<br><br><div class="gmail_quote">On Sun, Jul 15, 2012 at 7:55 PM, David Robillard <span dir="ltr"><<a href="mailto:d@drobilla.net" target="_blank">d@drobilla.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Fri, 2012-07-13 at 15:57 +0100, James Morris wrote:<br>
> Hi,<br>
><br>
> My sampler app has Non Session Mangement implemented but is currently<br>
> still referring to external files by their original path.<br>
><br>
> I want to use the symlink method as discussed fairly extensively here<br>
> but I'd like to know if there is any recommended strategy for naming<br>
> the symlink of a sample.<br>
><br>
> It could so happen that as far as the filesystem is concerned the only<br>
> discerning uniqueness between two samples is in the path (ie<br>
> kit1/snare1.wav and kit2/snare1.wav).<br>
><br>
><br>
> I've come up with three possible solutions to this (in my current order<br>
> of preference):<br>
><br>
><br>
> 1) symlink-to-sample created in a subdir named using a hash* of the<br>
> full path to external file<br>
><br>
> 2) painstakingly re-create the full path within the session dir and add<br>
> the symlink into that.<br>
><br>
> 3) some horrible text manipulation of the full path (ie replace / with<br>
> _) that is bound to fail.<br>
><br>
><br>
> * J. Liles mentioned SHA1 here:<br>
>   <a href="http://linuxaudio.org/mailarchive/lad/2012/3/30/189343" target="_blank">http://linuxaudio.org/mailarchive/lad/2012/3/30/189343</a><br>
><br>
> Are there other/better options or disagreements about (1) being a good<br>
> choice over the other options I've presented?<br>
<br>
</div>I just used the original name of the file, with a number added for<br>
uniqueness if necessary (which is very seldom the case).  It works and<br>
is much more human-friendly and straightforward than the above options.<br>
A "make this path unique by sticking a number on the end of it" function<br>
turns out to be pretty useful anyway.<br>
<br>
Of course, you need to actually check for existence of files to create<br>
it, which might be a problem in some cases (though not any I've<br>
encountered), but anything that assumes a mapping based on the current<br>
path is a unique identifier for a particular file's contents is bound to<br>
fail anyway.</blockquote><div><br>This is exactly what I do in Non-DAW as well. Use the original name and add an ordinal number until it's unique. <br></div></div><br>