[Mono-dev] [PATCH] MS.NET compatible Path.GetTempFileName

Kornél Pál kornelpal at hotmail.com
Fri Jan 6 18:22:28 EST 2006


Hi,

> How about just appending ".tmp" to the temp file name while
> still using ints for the pattern?

I don't insist on 16-bit numbers if you (other people) belive that 16-bits
are few and we need 32-bits I will accept it.

But if we want to provide the same behavior as MS.NET we have to use 16-bit
numbers. When I created the test case (attached to my previous message) and
runned it I realized that is't quite unlikely to have 65536 temp files at
the same time and in fact the global (system scoped) counter that is used by
GetTempFileName (Win32) is very unlikely to overflow (go back to 0 in this
case) altough the same counter is used regardless of file name prefix. If
someone wants to disable GetTempFileName by creating all possible file names
he can do with any arbitary count of bits as well.

I don't know whether anyone relies on the fact that counter is 16-bit only
but I think 16-bit is enough to count temporary files and in addition we can
provide an MS.NET compatible file naming pattern.

Note that Ben pointed out (in a private e-mail) that MS.NET 2.0 has a more
specific documentation that MS.NET 1.1:
http://msdn2.microsoft.com/en-us/library/system.io.path.gettempfilename.aspx

Kornél

----- Original Message -----
From: "Robert Jordan" <robertj at gmx.net>
To: <mono-devel-list at lists.ximian.com>
Sent: Saturday, January 07, 2006 12:01 AM
Subject: Re: [Mono-dev] [PATCH] MS.NET compatible Path.GetTempFileName


> Kornél,
>
>> The only thing I cannot understand it the fact that if I submit a patch
>> that
>> corrects an MS.NET bug in Mono it is rejected or isn't welcomed altought
>> the
>> same is true for a patch that implements an MS.NET bug.
>
> Well, in your first mail you did't explain why on earth mono
> have to mimic the same weird ushort tmpUUUU.tmp pattern :-)
>
> In your second mail you told us that just the extension is important.
>
> How about just appending ".tmp" to the temp file name while
> still using ints for the pattern?
>
> Robert
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>




More information about the Mono-devel-list mailing list