goto UNSEEKABLE;
}
#ifdef _USE_KNETFILE
- if(knet_seek(fp, rz->end, SEEK_SET) != rz->end){
+ knet_seek(fp, rz->end, SEEK_SET);
+ if(knet_tell(fp) != rz->end){
knet_seek(fp, rz->in, SEEK_SET);
#else
if(lseek(fd, rz->end, SEEK_SET) != rz->end){
#ifdef _USE_KNETFILE
knetFile *fd = knet_open(filename, "r");
if (fd == 0) {
- fprintf(stderr, "[_razf_open] fail to open remote file %s\n", filename);
+ fprintf(stderr, "[_razf_open] fail to open %s\n", filename);
return NULL;
}
#else
rz = razf_open_r(fd, _load_index);
} else if(strstr(mode, "w")){
#ifdef _WIN32
- fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644);
+ fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666);
#else
- fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0644);
+ fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666);
#endif
if(fd < 0) return NULL;
rz = razf_open_w(fd);