Home All Groups Group Topic Archive Search About

does the windows file handle change?

Author
15 Nov 2005 8:03 PM
Daniel
does the windows file handle change?

are file handles unique to the whole operating system or just the current
directoy? if a file is opened then closed then opened again, does the file
handle remain the same?

Author
15 Nov 2005 8:47 PM
Mattias Sjögren
>does the windows file handle change?

No, you get a handle each time you open a file and it's valid until
you close it. If the value changed it would be a different handle.


>are file handles unique to the whole operating system or just the current
>directoy?

Handles are not scoped by directory, they represent an open file
anywhere in the file system. That doesn't mean that they are unique
though. You could get the same handle value (for different files) in
different processes for example.


>if a file is opened then closed then opened again, does the file
>handle remain the same?

No. (Actually it could but in general it doesn't.)


Mattias

--
Mattias Sjögren [MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

AddThis Social Bookmark Button