Page 2 of 2
Posted: Mon Apr 09, 2007 11:27 am
by Oren
Thanks
feyd, but that's not what I meant... I know what a bitwise comparison is - I've done it so many times in school when we were working with Assembler (we did it manually... e.g we use a pen and a sheet of paper to verify things

).
Can you show me the same code in pseudo-code?
Posted: Mon Apr 09, 2007 11:29 am
by feyd
The code is as watered down as it can get.
Posted: Mon Apr 09, 2007 1:54 pm
by Benjamin
pseudo-code:
Code: Select all
function is_file(X)
{
return IS X A FILE?;
}
Just playing around..
Posted: Mon Apr 09, 2007 2:07 pm
by Weirdan
Oren wrote:I know some C, but very basic. Can you explain in words/pseudo code what these lines mean?
Judging by the code where S_IFMT used almost everywhere (presumably to cut off some unneeded bits from mode bitfield) they are just comparing mode bitfield to some predefined value. Basically it's just what astions has said.