read_file() why not use "r" and "rb" for the 2nd paramater?

new topic     » topic index » view thread      » older message » newer message

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

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu