Problem saving files

Richard Gaskin ambassador at fourthworld.com
Tue Jul 6 11:37:59 EDT 2010


David C. wrote:

>> I think Sarah's right, your code isn't checking to see if the file already
>> has the same extension. Add this to your "save" handler after you get the
>> user's file name:
>>
>> put ".ext" into tExtension -- use yours
>> set the itemDelimiter to "."
>> if last item of tFileName <> tExtension
>> then put tExension after tFilename
>>
>> Now you shouldn't get duplicate extensions and if the file exists it will be
>> overwritten.
>> --
>> Jacqueline Landman Gay
>
> Since it correctly prompts about the file replacement, I really
> thought that it would be handled accordingly by the Rev engine... live
> and learn as they say. :)

I just ran a test and was unable to reproduce the prompt:

I used "ask file whatever", and in the OS putfile dialog I typed the 
name of an existing file but without the extension.  The dialog did not 
prompt that this was a duplicate name.   I also tried a different 
extension, with the same result.

The only time I could get the OS dialog to report that the file name was 
the same as an existing file was when I included the file extension 
matching the existing file.

This is consistent with Rev's behavior too, since it will only overwrite 
the file if the complete name of the file is an exact match of an 
existing one.

Do you have a recipe for getting the OS dialog to report a duplicate 
name when the extension is different?  Which OS are you using?

--
  Richard Gaskin
  Fourth World
  Rev training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com
  revJournal blog: http://revjournal.com/blog.irv



More information about the use-livecode mailing list