469,579 Members | 1,214 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,579 developers. It's quick & easy.

How to get Win32 handle from FILE*

PLS
I'm writing native C++ using VS2005.

I have a FILE* for a file opened with fopen. I want to get the WIN32
file handle for this file so I can call GetFileTime on it.

I can get the descriptor number with _fileno, but there doesn't seem to
be a function to give me the handle from the descriptor number.

Any ideas how I can do this?

Thanks,
++PLS
Nov 29 '07 #1
1 4437
Use _fileno followed by _get_osfhandle.

Regards,

Brian Muth

"PLS" <no****@nowhere.comwrote in message news:MP************************@msnews.microsoft.c om...
I'm writing native C++ using VS2005.

I have a FILE* for a file opened with fopen. I want to get the WIN32
file handle for this file so I can call GetFileTime on it.

I can get the descriptor number with _fileno, but there doesn't seem to
be a function to give me the handle from the descriptor number.

Any ideas how I can do this?

Thanks,
++PLS
Nov 29 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

19 posts views Thread by Dave | last post: by
2 posts views Thread by Jorgen Grahn | last post: by
28 posts views Thread by Grant Edwards | last post: by
2 posts views Thread by Shawn Anderson | last post: by
2 posts views Thread by Steve Richter | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.