void FileName::set(string const & name)
{
d->fi.setFile(toqstr(name));
- BOOST_ASSERT(d->fi.isAbsolute());
}
bool FileName::changePermission(unsigned long int mode) const
{
- if (!isWritable()) {
- LYXERR0("File " << *this << " is not writable!");
- return false;
- }
-
#if defined (HAVE_CHMOD) && defined (HAVE_MODE_T)
if (::chmod(toFilesystemEncoding().c_str(), mode_t(mode)) != 0) {
LYXERR0("File " << *this << ": cannot change permission to "
string FileName::onlyFileName() const
{
- return support::onlyFilename(absFilename());
+ return fromqstr(d->fi.fileName());
}
FileName FileName::onlyPath() const
{
- return FileName(support::onlyPath(absFilename()));
+ FileName path;
+ path.d->fi.setFile(d->fi.path());
+ return path;
}