News for hackers. Stuff that matters.
Re:The Man Behind Windows PowerShell by cesarb on Thursday September 14, 2017 @08:24PM (#15253606)
> What's the difference between file descriptors and handles? Both are just opaque numeric identifiers.

The main difference I know of is that file descriptors are sequential, while handles are random. That is, a function like open() will always return the lowest-numbered available file descriptor, while CreateFile() can return any available handle.

Other than that, both are basically identical as far as I know: both are just keys to an in-kernel table which points to the real object.

Re:The Man Behind Windows PowerShell by int_19h on Thursday September 14, 2017 @08:46PM (#15253712)
> The main difference I know of is that file descriptors are sequential, while handles are random.

Is it an API guarantee, or just an irrelevant implementation detail?

Re:The Man Behind Windows PowerShell by cesarb on Thursday September 14, 2017 @09:31PM (#15253888)
For file descriptors, API guarantee, specified by POSIX: http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2...

"[...] atomically allocate the lowest numbered available (that is, not already open in the calling process) file descriptor [...]"