Problem saving files
Richard Gaskin
ambassador at fourthworld.com
Tue Jul 6 11:55:14 EDT 2010
David C. wrote:
>> 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
>
> Hi Richard,
> I'm using the code exactly as was shown in my original post, with the
> exception of the actual filename and extension which I made more
> generic for the sake of example. Here is the code again as well:
>
> on SaveTheFile
> ask file "Save project as:" with filter "MYFL file,*.myfl"
> if it <> "" then
> put it into tfile
> put fld "save list" into tFiletoSave
> put tFileToSave into url ("file:" & tfile & ".myfl")
> else
> exit to top
> end if
> end SaveTheFile
>
> I'm running Windows 7 Home Premium with admin privileges and the UAC turned on.
Ah, I was testing on Mac. I'm not at my Win box so I won't be able to
confirm there, but I suspect this is a bug/feature in Windows. Whether
it's a bug or a feature depends on one's point of view; IMO it should
only warn of an overwrite with an exact match, but there may be a valid
reason why the OS is using a more loose definition.
--
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