BiF prefix

Why does the BiF

    NFS3::mode2string%(mode: count%): string

have a prefix of NFS3? No other BiF has such a prefix.

    Matthias

Why does the BiF

    NFS3::mode2string%(mode: count%): string

have a prefix of NFS3?

Short version: blame Gregor, no doubt :-).

Slighty longer version: Presumably a "mode" in this context refers to an
NFSv3 protocol value that isn't meaningful in other contexts.

    Vern

Slighty longer version: Presumably a "mode" in this context refers to an
NFSv3 protocol value that isn't meaningful in other contexts.

That's what I was thinking, but looking at the implementation suggests
that it's quite a generic way of converting UNIX files permissions given
by a mode into a string of the form rw[xsS]rw[xsS]rw[xtT].

If I'm not overseeing a detail, I would suggest removing the prefix for
consistency and to indicate the broader usage scenario.

    Matthias

that it's quite a generic way of converting UNIX files permissions given
by a mode into a string of the form rw[xsS]rw[xsS]rw[xtT].

If I'm not overseeing a detail, I would suggest removing the prefix for
consistency and to indicate the broader usage scenario.

And maybe change it to have "file_mode" or "Unix_file_mode" in the name.

    Vern

And maybe change it to have "file_mode" or "Unix_file_mode" in the name.

Gregor, would you be okay with renaming the BiF to file_mode?

    Matthias

I added namespace support for BiF's with my work on NFS/RPC(*) and this one is the only new BiF I wrote. The idea is that in the long run we should migrate BiF's to appropriate namespaces.

cu
Gregor

(*) That's when I also added support for making types, globals, enums, etc. easily accessible in C++, BiF, and script land

Should work. I actually can't recall off the top of my head whether the file mode encoding used by NFS is indeed normal Unix modes. If so, go ahead and change it.

cu
Gregor

Should work. I actually can't recall off the top of my head whether
the file mode encoding used by NFS is indeed normal Unix modes. If so,
go ahead and change it.

I could not find anything NFS specific in your implementation based on
what I found about the S_* permissions [1], so I'll rename the function
to file_mode in my bif-cleanup branch.

    Matthias

[1] Permission Bits (The GNU C Library)