id3-go
id3-go copied to clipboard
Opening read-only files.
Currently, opening a read-only file fails. This is because id3.Open
opens the files in read write mode (os.OpenFile(name, os.O_RDWR, 0666)
).
One thought I had would be to fallback on read-only mode if readwrite mode fails. Then we could just throw an error if someone tries to write to the object. (is it still considered a breaking change if it changes when an error is given?)
Probably the least offensive change would be adding another function, maybe called Read
, which would be just like Load, except with os.O_RDONLY
. Would that be more confusing?
I think you can achieve something similar by opening the file read-only and then passing it to id3.Parse()
, https://github.com/mikkyang/id3-go/blob/master/id3.go#L50