user480780
user480780

Reputation: 23

Ruby naming question

I'm puzzled why File::CREAT is named that way. Why CREAT and not CREATE? TRUNC is ok. WRONLY, sure fine. but CREAT...

It seems ruby has weird name shortening scheme (which is readable, but usually is not intuitive) that is found in method names too.

Upvotes: 2

Views: 74

Answers (2)

user149341
user149341

Reputation:

The name of creat() is a sort of historical wart. When Kenneth Thompson was asked what he'd do if given the chance to go back and do one thing differently when designing UNIX, he famously answered "I'd spell creat() with an e".

So, no good reason really. :)

Upvotes: 6

jtbandes
jtbandes

Reputation: 118681

Probably based on open(2)'s flags.

Upvotes: 5

Related Questions