public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Convert a file descriptor from Cygwin openat() to Win32 file HANDLE?
@ 2024-03-04  6:16 Cedric Blancher
  2024-03-04  6:59 ` Mark Geisert
  2024-03-04  8:21 ` Andrey Repin
  0 siblings, 2 replies; 4+ messages in thread
From: Cedric Blancher @ 2024-03-04  6:16 UTC (permalink / raw)
  To: cygwin

Good morning!

How can I convert a file descriptor from Cygwin openat() to Win32 file HANDLE?

Ced
-- 
Cedric Blancher <cedric.blancher@gmail.com>
[https://plus.google.com/u/0/+CedricBlancher/]
Institute Pasteur

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Convert a file descriptor from Cygwin openat() to Win32 file HANDLE?
  2024-03-04  6:16 Convert a file descriptor from Cygwin openat() to Win32 file HANDLE? Cedric Blancher
@ 2024-03-04  6:59 ` Mark Geisert
  2024-03-04  8:21 ` Andrey Repin
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Geisert @ 2024-03-04  6:59 UTC (permalink / raw)
  To: cygwin

On 3/3/2024 10:16 PM, Cedric Blancher via Cygwin wrote:
> 
> How can I convert a file descriptor from Cygwin openat() to Win32 file HANDLE?

In general, this can be done with:
     hFile = (HANDLE) _get_osfhandle (int fd);

That works for simple cases such as disk file descriptors. I've learned 
one can't always depend on it because Cygwin can use several handles for 
a specific file or other object in certain situations, which I'm not 
going to list here because I don't know them all.

Try that and see if it works for your case.

..mark

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Convert a file descriptor from Cygwin openat() to Win32 file HANDLE?
  2024-03-04  6:16 Convert a file descriptor from Cygwin openat() to Win32 file HANDLE? Cedric Blancher
  2024-03-04  6:59 ` Mark Geisert
@ 2024-03-04  8:21 ` Andrey Repin
  2024-03-05  8:45   ` Cedric Blancher
  1 sibling, 1 reply; 4+ messages in thread
From: Andrey Repin @ 2024-03-04  8:21 UTC (permalink / raw)
  To: Cedric Blancher, cygwin

Greetings, Cedric Blancher!

> How can I convert a file descriptor from Cygwin openat() to Win32 file HANDLE?

In general, you should not attempt to do such thing.
If you have a very specific idea in mind, it would be best to describe, what
you are trying to achieve, so community could provide a more meaningful
suggestion to solve your specific issue.


-- 
With best regards,
Andrey Repin
Monday, March 4, 2024 11:19:58

Sorry for my terrible english...


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Convert a file descriptor from Cygwin openat() to Win32 file HANDLE?
  2024-03-04  8:21 ` Andrey Repin
@ 2024-03-05  8:45   ` Cedric Blancher
  0 siblings, 0 replies; 4+ messages in thread
From: Cedric Blancher @ 2024-03-05  8:45 UTC (permalink / raw)
  To: cygwin

On Mon, 4 Mar 2024 at 09:35, Andrey Repin <anrdaemon@yandex.ru> wrote:
>
> Greetings, Cedric Blancher!
>
> > How can I convert a file descriptor from Cygwin openat() to Win32 file HANDLE?
>
> In general, you should not attempt to do such thing.
> If you have a very specific idea in mind, it would be best to describe, what
> you are trying to achieve, so community could provide a more meaningful
> suggestion to solve your specific issue.

The idea is to add raw SID support for users and groups to /bin/ls,
and that only works with access to the raw SIDs

Ced
-- 
Cedric Blancher <cedric.blancher@gmail.com>
[https://plus.google.com/u/0/+CedricBlancher/]
Institute Pasteur

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-05  8:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-04  6:16 Convert a file descriptor from Cygwin openat() to Win32 file HANDLE? Cedric Blancher
2024-03-04  6:59 ` Mark Geisert
2024-03-04  8:21 ` Andrey Repin
2024-03-05  8:45   ` Cedric Blancher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).