Why do people write?

I have often wondered what motivates people to write.