read_file() why not use "r" and "rb" for the 2nd paramater?
- Posted by jeremy (admin) Sep 13, 2009
- 1026 views
Discussion in IRC came up about how read_file() and open() both accept a filename and "mode". Why did we move from the standard when creating read_file. It's understood that read_file() only reads, but we could limit the function to understand "r" and "rb" only mode strings, then working with files, we have a consistent API instead of using open("file.txt", "rb") in one case and another case read_file("file.txt", io:BINARY_MODE).
Jeremy