
On Mon, Oct 05, 2009 at 05:14:33PM -0400, Amy Griffis wrote:
Paolo Bonzini wrote: [Mon Oct 05 2009, 04:54:27AM EDT]
On 10/04/2009 09:28 PM, Amy Griffis wrote:
Add a utility to ensure an absolute path for a potentially realtive path.
Would it make sense for your usage to resolve symbolic links at the same time? If so, you can use the canonicalize-lgpl gnulib module, which portably provides the following function.
/* Return a malloc'd string containing the canonical absolute name of the named file. If any file name component does not exist or is a symlink to a nonexistent file, return NULL. A canonical name does not contain any `.', `..' components nor any repeated file name separators ('/') or symlinks. */ char *canonicalize_file_name (const char *);
In this case we don't need to resolve symlinks because the following open() will handle them. I suppose it could be useful to a future consumer, but I'm inclined to keep it as it is.
We already have a separate virFileResolveLink() which can be used no need to merge the two semantic, so I'm fine with the patch as-is. ACK, applied, thanks ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/