Ticket #12498 (closed defect: fixed)
[FIXED IN SVN] IGuestSession.directoryCreateTemp() API doesn't return dir name
|Reported by:||rjoyce||Owned by:|
The IGuestSession API function directoryCreateTemp() does not properly return the name of the new directory it creates. Instead, it returns the empty string. I'm testing from Java with an OS X 10.6 host and a Windows 7 guest, but the problem appears to be more general.
The problem seems to be in GuestSession::objectCreateTempInternal() in src/VBox/Main/src-client/GuestSessionImpl.cpp . It doesn't set the contents of the strName parameter anywhere -- that's where the return value (the directory name) would be propagated, if I understand correctly.
As an aside, that function interprets an empty strPath as "create a temporary directory in /tmp or equivalent", which would be a great feature to expose in the API. Unfortunately, the main function (GuestSession::DirectoryCreateTemp) explicitly guards against an empty string in aPath.