Uniqueness in Folder/File Naming

Recently, I had a friend who had asked me about what makes a folder or file name unique.  This project he was working on needed a unique file name, and my recommendation was the Session.SessionID used in the name would do it; of course, this was dependent on multiple files not having the same name in the session.

Recently, I've been reading ASP.NET 2.0 Advanced Topics by Dino Esposito, and the approached used by the .NET framework is to use two separate hashed folders, which determines the uniqueness of files placed in there.  If you go to c:\windows\microsoft.net\framework\<version>\temporary ASP.NET files, you will see your web projects as sub folders, followed by a series of hashed folders.

So I got to thinking that the hash approach probably would work well in determining uniqueness, as long as the hash length is sufficient.

Comments

# re: Uniqueness in Folder/File Naming

Friday, August 25, 2006 12:03 PM by dsmyth

hi, not sure if this will help but another option would be to use a GUID as the folder/file name. I've sometimes see that on my drive.

The leading UI suite for ASP.NET - Telerik radControls
Outstanding performance. Full ASP.NET AJAX support. Nearly codeless development.