Ethereal-dev: [Ethereal-dev] Proper checking when saving captures ...

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Richard Sharpe <rsharpe@xxxxxxxxxx>
Date: Mon, 15 Jul 2002 15:30:02 +0930 (CST)
Hi,

I was thinking about this some more, and it seems to me that we should do 
something like the following before trying to actually save the file or do 
anything else:

1. If the save name is the same as the capture file name, put up a dialog 
box and dissallow it as we do for one case currently. This should be for 
all cases, even for a temp file, because some LUSER might have patiently 
typed in the temp capture file name.

2. If that passes, then lstat (or whatever it is under Win32) the file to 
see if it exists, and if so, pop up a dialog box asking if the user really 
knows what they are doing.

Only after these two have been checked should do the normal stuff.

However, it is likely that there are other places where the user wants to 
save things where it might be appropriate to check is they know they are 
overwriting files.

Regards
-----
Richard Sharpe, rsharpe@xxxxxxxxxx, rsharpe@xxxxxxxxx, 
sharpe@xxxxxxxxxxxx