18 snprintf(error_msg_buffer,
sizeof(error_msg_buffer),
"File does not exist: %s", path);
21 snprintf(error_msg_buffer,
sizeof(error_msg_buffer),
"Permission denied (cannot read): %s", path);
24 snprintf(error_msg_buffer,
sizeof(error_msg_buffer),
"Is a directory, not a file: %s", path);
27 snprintf(error_msg_buffer,
sizeof(error_msg_buffer),
"Failed to open for reading: %s (%s)", path,
platform_strerror(errno));
30 return error_msg_buffer;
36 snprintf(error_msg_buffer,
sizeof(error_msg_buffer),
"Directory does not exist: %s", path);
39 snprintf(error_msg_buffer,
sizeof(error_msg_buffer),
"Permission denied (cannot write): %s", path);
42 snprintf(error_msg_buffer,
sizeof(error_msg_buffer),
"Read-only filesystem: %s", path);
45 snprintf(error_msg_buffer,
sizeof(error_msg_buffer),
"No space left on device: %s", path);
48 snprintf(error_msg_buffer,
sizeof(error_msg_buffer),
"Is a directory, not a file: %s", path);
51 snprintf(error_msg_buffer,
sizeof(error_msg_buffer),
"Failed to open for writing: %s (%s)", path,
platform_strerror(errno));
54 return error_msg_buffer;