Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby naming question

Tags:

ruby

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.

like image 957
user480780 Avatar asked Dec 22 '25 23:12

user480780


2 Answers

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. :)

Probably based on open(2)'s flags.

like image 26
jtbandes Avatar answered Dec 25 '25 20:12

jtbandes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!