mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
get rid of lyxlib.h:chmod.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22126 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
4752cc8d61
commit
2e34b2876a
@ -169,7 +169,7 @@ void ConverterCache::Impl::writeIndex()
|
||||
FileName const index(addName(cache_dir.absFilename(), "index"));
|
||||
ofstream os(index.toFilesystemEncoding().c_str());
|
||||
os.close();
|
||||
if (!chmod(index, 0600))
|
||||
if (!index.changePermission(0600))
|
||||
return;
|
||||
os.open(index.toFilesystemEncoding().c_str());
|
||||
CacheType::iterator it1 = cache.begin();
|
||||
|
@ -157,10 +157,13 @@ bool FileName::changePermission(unsigned long int mode) const
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!chmod(*this, mode)) {
|
||||
LYXERR0("File " << *this << " cannot be changed to " << mode << " mode!");
|
||||
#if defined (HAVE_CHMOD) && defined (HAVE_MODE_T)
|
||||
if (::chmod(file.toFilesystemEncoding().c_str(), mode_t(mode)) != 0) {
|
||||
LYXERR0("File " << *this << ": cannot change permission to "
|
||||
<< mode << ".");
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ using namespace std;
|
||||
namespace lyx {
|
||||
namespace support {
|
||||
|
||||
bool chmod(FileName const & file, unsigned long int mode)
|
||||
static bool chmod(FileName const & file, unsigned long int mode)
|
||||
{
|
||||
#if defined (HAVE_CHMOD) && defined (HAVE_MODE_T)
|
||||
if (::chmod(file.toFilesystemEncoding().c_str(), mode_t(mode)) != 0)
|
||||
|
@ -25,8 +25,7 @@ namespace support {
|
||||
|
||||
/// get the current working directory
|
||||
FileName const getcwd();
|
||||
/// Change file permissions
|
||||
bool chmod(FileName const & file, unsigned long int mode);
|
||||
|
||||
/**
|
||||
* rename a file, returns false if it fails.
|
||||
* It can handle renames across partitions.
|
||||
|
Loading…
Reference in New Issue
Block a user