What is File vs !File in Ruby

What is !File in Ruby?

I was able find "File" in the documentation but not "!File".

if !File.directory? real_dir 	

Open in new window

is an example of it and I don't know if it simply means "opposite" of File or...
Who is Participating?
GaryConnect With a Mentor Commented:
It's called a NOT operator i.e. condition must be false

Paul JacksonConnect With a Mentor Software EngineerCommented:
! is a logical NOT operator so when you put it in fromt of anything you are checking for the opposite of it.

Mark_CoAuthor Commented:
Ok, that's what i was thinking. I just didn't see it in the documentation so I figured it had to be something so simple.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.