PDA

View Full Version : Problem with Save As and Rename


andy
December 5th 03, 01:37 AM
There's an interesting issue when I use the Save As common
dialog box if I rename the file via the file list control.
For example:
Open Notepad.
Type in some text.
File -> Save As...
Go to a folder with a text file and select it.
The File Name edit control changes to the file name.
Press F2 to rename the file (from say readme.txt to
readme.txx). Enter, and accept the message about changing
the extension.
Note that the file name in the list control changes to
readme.txx, but that in the edit control stays as
readme.txt.
Click Save.
See message informing that the file "readme.txx" already
exists and offering to overwrite. Select No.
In the edit control, edit the name from "readme.txt"
to "readme.txt" (looks the same...).
Click Save.
The file gets saved to "readme.txt".

It looks as though the File Name edit control is not being
updated when some internal file name data is changed. Or,
the save uses the internal data without bothering to re-
read the edit control content.

This also happens from email when doing a Save As, and not
wanting to overwrite the original file, so using the list
control to rename the original file as the last minute.

Andy.

Sharon F
December 5th 03, 01:40 AM
On Fri, 27 Jun 2003 06:36:49 -0700, "andy" > wrote:

>There's an interesting issue when I use the Save As common
>dialog box if I rename the file via the file list control.
>For example:
> Open Notepad.
> Type in some text.
> File -> Save As...
> Go to a folder with a text file and select it.
> The File Name edit control changes to the file name.
> Press F2 to rename the file (from say readme.txt to
>readme.txx). Enter, and accept the message about changing
>the extension.
> Note that the file name in the list control changes to
>readme.txx, but that in the edit control stays as
>readme.txt.
> Click Save.
> See message informing that the file "readme.txx" already
>exists and offering to overwrite. Select No.
> In the edit control, edit the name from "readme.txt"
>to "readme.txt" (looks the same...).
> Click Save.
> The file gets saved to "readme.txt".
>
>It looks as though the File Name edit control is not being
>updated when some internal file name data is changed. Or,
>the save uses the internal data without bothering to re-
>read the edit control content.
>
>This also happens from email when doing a Save As, and not
>wanting to overwrite the original file, so using the list
>control to rename the original file as the last minute.
>
>Andy.

Interesting but I can't duplicate it with Notepad on my XP setup. Also,
this situation can be easily avoided. Change the name of the file that
you are saving instead of the name of the original. Example : Leave
original filename of email.txt the way it is. Save second email message
as email2.txt

Sharon F
MS MVP [Shell/User]

Google