Added chmod for all file creation functions

pull/35/head
parent ea75f56c35
commit a1846fd154

@ -2227,6 +2227,7 @@ config_str yon_file_open(char *file_path, int *size){
int yon_file_save(char *file_path, char *text){
FILE *file = fopen(file_path,"w");
chmod(file_path,0777);
if (file){
fputs(text,file);
fclose(file);
@ -2240,6 +2241,7 @@ int yon_file_create(char *path, char *name, int rules){
char *full_path = yon_char_unite(path,"/",name,NULL);
if (access(full_path,F_OK)){
FILE *fl = fopen(full_path,"w");
chmod(full_path,0777);
if (fl){
chmod(full_path,rules);
fclose(fl);
@ -2259,6 +2261,7 @@ int yon_file_create_full_path(char *path, int rules){
if (path){
if (access(path,F_OK)){
FILE *fl = fopen(path,"w");
chmod(path,0777);
if (fl){
chmod(path,rules);
fclose(fl);

Loading…
Cancel
Save