open (LOGFILE, ">/home/database.db") ;
print LOGFILE "Here goes the data\n";
close (LOGFILE) ;
Above given is the simple script. IF database.db is not existing script will create the file automatically. But the problem is it is created with the permissions of 0644. I want to create it with permission 0666 by the script. I tried.
open (LOGFILE, ">/home/database.db") ;
print LOGFILE "Here goes the data\n";
close (LOGFILE) ;
chmod (0666, '/home/database.db');
But it's not working, any solution to it?
Thanks,
Zeshan.
print LOGFILE "Here goes the data\n";
close (LOGFILE) ;
Above given is the simple script. IF database.db is not existing script will create the file automatically. But the problem is it is created with the permissions of 0644. I want to create it with permission 0666 by the script. I tried.
open (LOGFILE, ">/home/database.db") ;
print LOGFILE "Here goes the data\n";
close (LOGFILE) ;
chmod (0666, '/home/database.db');
But it's not working, any solution to it?
Thanks,
Zeshan.