Hi Stephan,

Alle 15:39, lunedì 21 agosto 2006, Stephan Bergmann ha scritto:
> Paolo Mantovani wrote:
> > Hi all,
> >
> > an Italian user has reported an incident with the SaveDataToFile
> > function, contained in the module UCB of the "Tools" library
>
> ..then this mail seems more appropriate for the [email protected]
> mailing list.  Or, directly file an issue against ucb.


In effect I'm not complaining about the XSimpleFileAccess .Kill method 
implementation.
The IDL docu says clearly that the kill method can delete directories.

The problem is only in the implementation of the SaveDataToFile basic 
function, because it does not check properly the URL passed.

You of course could say that checking the URL validity it should be a 
responsibility of the caller and I agree, but in this case, the damage for a 
(e.g.) wrong copy/paste of an url could be very serious.

Again you could say that Tools library is not conceived for being used 
from "thirdy part" macros.
I can't say nothing against this because there isn't any specific 
documentation about the Tools library, but consider also that the StarBasic 
Help contains several examples showing the use of some functions called from 
the Tools library

Anyway, what I'm proposing it's only to change a line in the function 
SaveDataToFile() :

from :
If oUcb.Exists(FilePath) Then
...


to :
If oUcb.Exists(FilePath) And Not oUcb.isFolder(FilePath) Then
...

IMHO this change should not affect any existing macros and would make the 
function safer 


thank you 
Paolo M

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to