how can i save a file with RWX access for UGO using ofstream.
- From: "nass" <athanasios.silis@xxxxxxxxx>
- Date: 28 Mar 2007 08:05:54 -0700
hello everyone,
im loooking into how to save a file that is RW accessible to ALL .
but i haven't found any reference in ofstream that gives me that
ability.
of course iostream library is not linux dependent so it is only
natural that this would be the case.
however what options do i have?
as in is it possible to change the umask of the system of smth else?
or do smth anyway that will enable me to do that?
this is my saving function:
void ConfigFile::CfgWrite (const string &filename,const string &path)
{
string cfgfile;
string bakfile;
cfgfile=path+filename+".cfg";
bakfile=path+filename+".bak";
remove (bakfile.c_str());
rename(cfgfile.c_str(),bakfile.c_str());
std::ofstream out(cfgfile.c_str());
out<<"#"+filename+" configuration file \r\n";
out<<(*this);
out.flush();
out.close();
return;
}
where "this" is a class that is in itself a buffer that holds the data
you want to write to a file.
.
- Follow-Ups:
- Prev by Date: Help with ELF's ".symtab" section
- Next by Date: dlclose and RTLD_GLOBAL
- Previous by thread: Help with ELF's ".symtab" section
- Next by thread: Re: how can i save a file with RWX access for UGO using ofstream.
- Index(es):