Ethereal-dev: Re: [ethereal-dev] [PATCH] Saving a temporary file on WIN32

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

From: Gilbert Ramirez <gram@xxxxxxxxxx>
Date: Thu, 23 Mar 2000 08:05:25 -0600
On Thu, Mar 23, 2000 at 04:36:28AM -0600, andreas.sikkema@xxxxxxxxxxx wrote:
> 
> 
> Hi
> 
> If you capture some traffic without supplying a filename and tried to save
> that capture later (after filtering it or something) on WIN32 you will 
> receive
> an error indicating that the file cannot be moved. Ethereal is trying to
> move the file, while it should copy it.
> 
> Attached is a patch that solves this problem, but it uncovers another bug.
> It seems that there's something not quite right with the file that is the
> result of the copy operation. I have attached the source and
> destination files because I can't seem to find anything wrong with
> the current code and I'm not knowledgeable enough concerning the
> file formats used.


Thanks. The corrupt file has 0d:0a where the original had 0a. I see
the first occurence at byte 0x481 in those files.

It's the CRLF/LF difference again.

When copying the file, we *are* opening the from-file with the O_BINARY
flag, but the creat() call that we use to create the to-file doesn't
have such a flag.

(in file.c, the open() is on line 1446, the creat() is on line 1454)

I'll investigate what to do on Win32, but if someone else knows
offhand, plese tell us!

--gilbert