this commit:
add write access to files opened by eina_file_open on Windows. By design, it should be read-only (see documentation)
This must be fixed.
this commit:
add write access to files opened by eina_file_open on Windows. By design, it should be read-only (see documentation)
This must be fixed.
actually even though this looks wrong i think this is a side-effect of window's bizarre file/io semantics. based on a bunch of "windows fixes" for when writing eet files recently i think this is here because IN CASE you happen to also have the file open for writing somewhere else you need to also open for write here or things "god bad". that's a guess.
other than this it certainly sounds/looks wrong and the git commit log doesn't provide any information on why this is needed.
handle = CreateFile(filename,
+ GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
NULL)
GENERIC_READ - opens the file read-only
FILE_SHARE_READ | FILE_SHARE_WRITE - other processes have the right to read and write to this file
for Linux
eina_file_open
...
fd = open(filename, O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO);
O_RDONLY - opens the file read-only
S_IRWXU | S_IRWXG | S_IRWXO - - other processes have the right to read and write to this file
yeah. that was added. the question is - why? i think it's because some other code may then also open the file read/write and thus opening a second time fails because it's already open read-only.... right?