• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KIOSlave

  • kioslave
  • file
file_unix.cpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2000-2002 Stephan Kulow <coolo@kde.org>
3 Copyright (C) 2000-2002 David Faure <faure@kde.org>
4 Copyright (C) 2000-2002 Waldo Bastian <bastian@kde.org>
5 Copyright (C) 2006 Allan Sandfeld Jensen <sandfeld@kde.org>
6 Copyright (C) 2007 Thiago Macieira <thiago@kde.org>
7 Copyright (C) 2007 Christian Ehrlicher <ch.ehrlicher@gmx.de>
8
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public
11 License (LGPL) as published by the Free Software Foundation;
12 either version 2 of the License, or (at your option) any later
13 version.
14
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Library General Public License for more details.
19
20 You should have received a copy of the GNU Library General Public License
21 along with this library; see the file COPYING.LIB. If not, write to
22 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 Boston, MA 02110-1301, USA.
24*/
25
26#define QT_NO_CAST_FROM_ASCII
27
28#include "file.h"
29
30#include <config.h>
31#include <config-kioslave-file.h>
32
33#include <QtCore/QFile>
34#include <QtCore/QDir>
35
36#include <kde_file.h>
37#include <kdebug.h>
38#include <kconfiggroup.h>
39#include <kmountpoint.h>
40
41#include <dirent.h>
42#include <errno.h>
43#include <fcntl.h>
44#include <grp.h>
45#include <utime.h>
46#include <pwd.h>
47#include <stdlib.h>
48
49#if defined(HAVE_LIMITS_H)
50#include <limits.h> // PATH_MAX
51#endif
52
53//sendfile has different semantics in different platforms
54#if defined HAVE_SENDFILE && defined Q_OS_LINUX
55#define USE_SENDFILE 1
56#endif
57
58#ifdef USE_SENDFILE
59#include <sys/sendfile.h>
60#endif
61
62using namespace KIO;
63
64#define MAX_IPC_SIZE (1024*32)
65
66static bool
67same_inode(const KDE_struct_stat &src, const KDE_struct_stat &dest)
68{
69 if (src.st_ino == dest.st_ino &&
70 src.st_dev == dest.st_dev)
71 return true;
72
73 return false;
74}
75
76extern int write_all(int fd, const char *buf, size_t len);
77
78void FileProtocol::copy( const KUrl &srcUrl, const KUrl &destUrl,
79 int _mode, JobFlags _flags )
80{
81 kDebug(7101) << "copy(): " << srcUrl << " -> " << destUrl << ", mode=" << _mode;
82
83 const QString src = srcUrl.toLocalFile();
84 const QString dest = destUrl.toLocalFile();
85 QByteArray _src( QFile::encodeName(src));
86 QByteArray _dest( QFile::encodeName(dest));
87 KDE_struct_stat buff_src;
88#ifdef HAVE_POSIX_ACL
89 acl_t acl;
90#endif
91
92 if ( KDE_stat( _src.data(), &buff_src ) == -1 ) {
93 if ( errno == EACCES )
94 error(KIO::ERR_ACCESS_DENIED, src);
95 else
96 error(KIO::ERR_DOES_NOT_EXIST, src);
97 return;
98 }
99
100 if ( S_ISDIR( buff_src.st_mode ) ) {
101 error(KIO::ERR_IS_DIRECTORY, src);
102 return;
103 }
104 if ( S_ISFIFO( buff_src.st_mode ) || S_ISSOCK ( buff_src.st_mode ) ) {
105 error(KIO::ERR_CANNOT_OPEN_FOR_READING, src);
106 return;
107 }
108
109 KDE_struct_stat buff_dest;
110 bool dest_exists = ( KDE_lstat( _dest.data(), &buff_dest ) != -1 );
111 if ( dest_exists )
112 {
113 if ( same_inode( buff_dest, buff_src) )
114 {
115 error(KIO::ERR_IDENTICAL_FILES, dest);
116 return;
117 }
118
119 if (S_ISDIR(buff_dest.st_mode))
120 {
121 error(KIO::ERR_DIR_ALREADY_EXIST, dest);
122 return;
123 }
124
125 if (!(_flags & KIO::Overwrite))
126 {
127 error(KIO::ERR_FILE_ALREADY_EXIST, dest);
128 return;
129 }
130
131 // If the destination is a symlink and overwrite is TRUE,
132 // remove the symlink first to prevent the scenario where
133 // the symlink actually points to current source!
134 if ((_flags & KIO::Overwrite) && S_ISLNK(buff_dest.st_mode))
135 {
136 //kDebug(7101) << "copy(): LINK DESTINATION";
137 remove( _dest.data() );
138 }
139 }
140
141 int src_fd = KDE_open( _src.data(), O_RDONLY);
142 if ( src_fd < 0 ) {
143 error(KIO::ERR_CANNOT_OPEN_FOR_READING, src);
144 return;
145 }
146
147#if HAVE_FADVISE
148 posix_fadvise(src_fd,0,0,POSIX_FADV_SEQUENTIAL);
149#endif
150 // WABA: Make sure that we keep writing permissions ourselves,
151 // otherwise we can be in for a surprise on NFS.
152 mode_t initialMode;
153 if (_mode != -1)
154 initialMode = _mode | S_IWUSR;
155 else
156 initialMode = 0666;
157
158 int dest_fd = KDE_open(_dest.data(), O_CREAT | O_TRUNC | O_WRONLY, initialMode);
159 if ( dest_fd < 0 ) {
160 kDebug(7101) << "###### COULD NOT WRITE " << dest;
161 if ( errno == EACCES ) {
162 error(KIO::ERR_WRITE_ACCESS_DENIED, dest);
163 } else {
164 error(KIO::ERR_CANNOT_OPEN_FOR_WRITING, dest);
165 }
166 ::close(src_fd);
167 return;
168 }
169
170#if HAVE_FADVISE
171 posix_fadvise(dest_fd,0,0,POSIX_FADV_SEQUENTIAL);
172#endif
173
174#ifdef HAVE_POSIX_ACL
175 acl = acl_get_fd(src_fd);
176 if ( acl && !isExtendedACL( acl ) ) {
177 kDebug(7101) << _dest.data() << " doesn't have extended ACL";
178 acl_free( acl );
179 acl = NULL;
180 }
181#endif
182 totalSize( buff_src.st_size );
183
184 KIO::filesize_t processed_size = 0;
185 char buffer[ MAX_IPC_SIZE ];
186 int n;
187#ifdef USE_SENDFILE
188 bool use_sendfile=buff_src.st_size < 0x7FFFFFFF;
189#endif
190 while( 1 )
191 {
192#ifdef USE_SENDFILE
193 if (use_sendfile) {
194 off_t sf = processed_size;
195 n = KDE_sendfile( dest_fd, src_fd, &sf, MAX_IPC_SIZE );
196 processed_size = sf;
197 if ( n == -1 && ( errno == EINVAL || errno == ENOSYS ) ) { //not all filesystems support sendfile()
198 kDebug(7101) << "sendfile() not supported, falling back ";
199 use_sendfile = false;
200 }
201 }
202 if (!use_sendfile)
203#endif
204 n = ::read( src_fd, buffer, MAX_IPC_SIZE );
205
206 if (n == -1)
207 {
208 if (errno == EINTR)
209 continue;
210#ifdef USE_SENDFILE
211 if ( use_sendfile ) {
212 kDebug(7101) << "sendfile() error:" << strerror(errno);
213 if ( errno == ENOSPC ) // disk full
214 {
215 error(KIO::ERR_DISK_FULL, dest);
216 remove( _dest.data() );
217 }
218 else {
219 error(KIO::ERR_SLAVE_DEFINED,
220 i18n("Cannot copy file from %1 to %2. (Errno: %3)",
221 src, dest, errno));
222 }
223 } else
224#endif
225 error(KIO::ERR_COULD_NOT_READ, src);
226 ::close(src_fd);
227 ::close(dest_fd);
228#ifdef HAVE_POSIX_ACL
229 if (acl) acl_free(acl);
230#endif
231 return;
232 }
233 if (n == 0)
234 break; // Finished
235#ifdef USE_SENDFILE
236 if ( !use_sendfile ) {
237#endif
238 if (write_all( dest_fd, buffer, n))
239 {
240 ::close(src_fd);
241 ::close(dest_fd);
242
243 if ( errno == ENOSPC ) // disk full
244 {
245 error(KIO::ERR_DISK_FULL, dest);
246 remove( _dest.data() );
247 }
248 else
249 {
250 kWarning(7101) << "Couldn't write[2]. Error:" << strerror(errno);
251 error(KIO::ERR_COULD_NOT_WRITE, dest);
252 }
253#ifdef HAVE_POSIX_ACL
254 if (acl) acl_free(acl);
255#endif
256 return;
257 }
258 processed_size += n;
259#ifdef USE_SENDFILE
260 }
261#endif
262 processedSize( processed_size );
263 }
264
265 ::close( src_fd );
266
267 if (::close( dest_fd))
268 {
269 kWarning(7101) << "Error when closing file descriptor[2]:" << strerror(errno);
270 error(KIO::ERR_COULD_NOT_WRITE, dest);
271#ifdef HAVE_POSIX_ACL
272 if (acl) acl_free(acl);
273#endif
274 return;
275 }
276
277 // set final permissions
278 if ( _mode != -1 )
279 {
280 if ( (::chmod(_dest.data(), _mode) != 0)
281#ifdef HAVE_POSIX_ACL
282 || (acl && acl_set_file(_dest.data(), ACL_TYPE_ACCESS, acl) != 0)
283#endif
284 )
285 {
286 KMountPoint::Ptr mp = KMountPoint::currentMountPoints().findByPath(dest);
287 // Eat the error if the filesystem apparently doesn't support chmod.
288 if ( mp && mp->testFileSystemFlag( KMountPoint::SupportsChmod ) )
289 warning(i18n("Could not change permissions for\n%1", dest));
290 }
291 }
292#ifdef HAVE_POSIX_ACL
293 if (acl) acl_free(acl);
294#endif
295
296 // copy access and modification time
297 struct utimbuf ut;
298 ut.actime = buff_src.st_atime;
299 ut.modtime = buff_src.st_mtime;
300 if ( ::utime( _dest.data(), &ut ) != 0 )
301 {
302 kWarning() << QString::fromLatin1("Couldn't preserve access and modification time for\n%1").arg(dest);
303 }
304
305 processedSize( buff_src.st_size );
306 finished();
307}
308
309void FileProtocol::listDir( const KUrl& url)
310{
311 if (!url.isLocalFile()) {
312 KUrl redir(url);
313 redir.setProtocol(config()->readEntry("DefaultRemoteProtocol", "smb"));
314 redirection(redir);
315 kDebug(7101) << "redirecting to " << redir.url();
316 finished();
317 return;
318 }
319 const QString path(url.toLocalFile());
320 const QByteArray _path(QFile::encodeName(path));
321 DIR* dp = opendir(_path.data());
322 if (dp == 0) {
323 switch (errno) {
324 case ENOENT:
325 error(KIO::ERR_DOES_NOT_EXIST, path);
326 return;
327 case ENOTDIR:
328 error(KIO::ERR_IS_FILE, path);
329 break;
330#ifdef ENOMEDIUM
331 case ENOMEDIUM:
332 error(ERR_SLAVE_DEFINED,
333 i18n("No media in device for %1", path));
334 break;
335#endif
336 default:
337 error(KIO::ERR_CANNOT_ENTER_DIRECTORY, path);
338 break;
339 }
340 return;
341 }
342
343 /* set the current dir to the path to speed up
344 in not having to pass an absolute path.
345 We restore the path later to get out of the
346 path - the kernel wouldn't unmount or delete
347 directories we keep as active directory. And
348 as the slave runs in the background, it's hard
349 to see for the user what the problem would be */
350 const QString pathBuffer(QDir::currentPath());
351 if (!QDir::setCurrent(path)) {
352 closedir(dp);
353 error(ERR_CANNOT_ENTER_DIRECTORY, path);
354 return;
355 }
356
357 const QString sDetails = metaData(QLatin1String("details"));
358 const int details = sDetails.isEmpty() ? 2 : sDetails.toInt();
359 //kDebug(7101) << "========= LIST " << url << "details=" << details << " =========";
360 UDSEntry entry;
361
362#ifndef HAVE_DIRENT_D_TYPE
363 KDE_struct_stat st;
364#endif
365 KDE_struct_dirent *ep;
366 while ((ep = KDE_readdir(dp)) != 0 ) {
367 entry.clear();
368
369 const QString filename = QFile::decodeName(ep->d_name);
370
371 /*
372 * details == 0 (if statement) is the fast code path.
373 * We only get the file name and type. After that we emit
374 * the result.
375 *
376 * The else statement is the slow path that requests all
377 * file information in file.cpp. It executes a stat call
378 * for every entry thus becoming slower.
379 *
380 */
381 if (details == 0) {
382 entry.insert(KIO::UDSEntry::UDS_NAME, filename);
383#ifdef HAVE_DIRENT_D_TYPE
384 entry.insert(KIO::UDSEntry::UDS_FILE_TYPE,
385 (ep->d_type == DT_DIR) ? S_IFDIR : S_IFREG );
386 const bool isSymLink = (ep->d_type == DT_LNK);
387#else
388 // oops, no fast way, we need to stat (e.g. on Solaris)
389 if (KDE_lstat(ep->d_name, &st) == -1) {
390 continue; // how can stat fail?
391 }
392 entry.insert(KIO::UDSEntry::UDS_FILE_TYPE,
393 (S_ISDIR(st.st_mode)) ? S_IFDIR : S_IFREG );
394 const bool isSymLink = S_ISLNK(st.st_mode);
395#endif
396 if (isSymLink) {
397 // for symlinks obey the UDSEntry contract and provide UDS_LINK_DEST
398 // even if we don't know the link dest (and DeleteJob doesn't care...)
399 entry.insert(KIO::UDSEntry::UDS_LINK_DEST, QLatin1String("Dummy Link Target"));
400 }
401 listEntry(entry, false);
402
403 } else {
404 if (createUDSEntry(filename, QByteArray(ep->d_name), entry, details, true)) {
405 listEntry(entry, false);
406 }
407 }
408 }
409
410 closedir(dp);
411 listEntry(entry, true); // ready
412
413 // Restore the path
414 QDir::setCurrent(pathBuffer);
415
416 finished();
417}
418
419void FileProtocol::rename( const KUrl &srcUrl, const KUrl &destUrl,
420 KIO::JobFlags _flags )
421{
422 char off_t_should_be_64_bits[sizeof(off_t) >= 8 ? 1 : -1]; (void) off_t_should_be_64_bits;
423 const QString src = srcUrl.toLocalFile();
424 const QString dest = destUrl.toLocalFile();
425 const QByteArray _src(QFile::encodeName(src));
426 const QByteArray _dest(QFile::encodeName(dest));
427 KDE_struct_stat buff_src;
428 if ( KDE_lstat( _src.data(), &buff_src ) == -1 ) {
429 if ( errno == EACCES )
430 error(KIO::ERR_ACCESS_DENIED, src);
431 else
432 error(KIO::ERR_DOES_NOT_EXIST, src);
433 return;
434 }
435
436 KDE_struct_stat buff_dest;
437 // stat symlinks here (lstat, not stat), to avoid ERR_IDENTICAL_FILES when replacing symlink
438 // with its target (#169547)
439 bool dest_exists = ( KDE_lstat( _dest.data(), &buff_dest ) != -1 );
440 if ( dest_exists )
441 {
442 if ( same_inode( buff_dest, buff_src) )
443 {
444 error(KIO::ERR_IDENTICAL_FILES, dest);
445 return;
446 }
447
448 if (S_ISDIR(buff_dest.st_mode))
449 {
450 error(KIO::ERR_DIR_ALREADY_EXIST, dest);
451 return;
452 }
453
454 if (!(_flags & KIO::Overwrite))
455 {
456 error(KIO::ERR_FILE_ALREADY_EXIST, dest);
457 return;
458 }
459 }
460
461 if ( KDE_rename( _src.data(), _dest.data()))
462 {
463 if (( errno == EACCES ) || (errno == EPERM)) {
464 error(KIO::ERR_ACCESS_DENIED, dest);
465 }
466 else if (errno == EXDEV) {
467 error(KIO::ERR_UNSUPPORTED_ACTION, QLatin1String("rename"));
468 }
469 else if (errno == EROFS) { // The file is on a read-only filesystem
470 error(KIO::ERR_CANNOT_DELETE, src);
471 }
472 else {
473 error(KIO::ERR_CANNOT_RENAME, src);
474 }
475 return;
476 }
477
478 finished();
479}
480
481void FileProtocol::symlink( const QString &target, const KUrl &destUrl, KIO::JobFlags flags )
482{
483 const QString dest = destUrl.toLocalFile();
484 // Assume dest is local too (wouldn't be here otherwise)
485 if ( ::symlink( QFile::encodeName(target), QFile::encodeName(dest) ) == -1 )
486 {
487 // Does the destination already exist ?
488 if ( errno == EEXIST )
489 {
490 if ( (flags & KIO::Overwrite) )
491 {
492 // Try to delete the destination
493 if ( unlink( QFile::encodeName(dest) ) != 0 )
494 {
495 error(KIO::ERR_CANNOT_DELETE, dest);
496 return;
497 }
498 // Try again - this won't loop forever since unlink succeeded
499 symlink( target, destUrl, flags );
500 }
501 else
502 {
503 KDE_struct_stat buff_dest;
504 if (KDE_lstat(QFile::encodeName(dest), &buff_dest) == 0 && S_ISDIR(buff_dest.st_mode))
505 error(KIO::ERR_DIR_ALREADY_EXIST, dest);
506 else
507 error(KIO::ERR_FILE_ALREADY_EXIST, dest);
508 return;
509 }
510 }
511 else
512 {
513 // Some error occurred while we tried to symlink
514 error(KIO::ERR_CANNOT_SYMLINK, dest);
515 return;
516 }
517 }
518 finished();
519}
520
521void FileProtocol::del(const KUrl& url, bool isfile)
522{
523 const QString path = url.toLocalFile();
524 const QByteArray _path( QFile::encodeName(path));
525 /*****
526 * Delete files
527 *****/
528
529 if (isfile) {
530 kDebug(7101) << "Deleting file "<< url;
531
532 if ( unlink( _path.data() ) == -1 ) {
533 if ((errno == EACCES) || (errno == EPERM))
534 error(KIO::ERR_ACCESS_DENIED, path);
535 else if (errno == EISDIR)
536 error(KIO::ERR_IS_DIRECTORY, path);
537 else
538 error(KIO::ERR_CANNOT_DELETE, path);
539 return;
540 }
541 } else {
542
543 /*****
544 * Delete empty directory
545 *****/
546
547 kDebug( 7101 ) << "Deleting directory " << url.url();
548 if (metaData(QLatin1String("recurse")) == QLatin1String("true")) {
549 if (!deleteRecursive(path))
550 return;
551 }
552 if ( ::rmdir( _path.data() ) == -1 ) {
553 if ((errno == EACCES) || (errno == EPERM))
554 error(KIO::ERR_ACCESS_DENIED, path);
555 else {
556 kDebug( 7101 ) << "could not rmdir " << perror;
557 error(KIO::ERR_COULD_NOT_RMDIR, path);
558 return;
559 }
560 }
561 }
562
563 finished();
564}
565
566void FileProtocol::chown( const KUrl& url, const QString& owner, const QString& group )
567{
568 const QString path = url.toLocalFile();
569 const QByteArray _path( QFile::encodeName(path) );
570 uid_t uid;
571 gid_t gid;
572
573 // get uid from given owner
574 {
575 struct passwd *p = ::getpwnam(owner.toLatin1());
576
577 if ( ! p ) {
578 error( KIO::ERR_SLAVE_DEFINED,
579 i18n( "Could not get user id for given user name %1", owner ) );
580 return;
581 }
582
583 uid = p->pw_uid;
584 }
585
586 // get gid from given group
587 {
588 struct group *p = ::getgrnam(group.toLatin1());
589
590 if ( ! p ) {
591 error( KIO::ERR_SLAVE_DEFINED,
592 i18n( "Could not get group id for given group name %1", group ) );
593 return;
594 }
595
596 gid = p->gr_gid;
597 }
598
599 if ( ::chown(_path, uid, gid) == -1 ) {
600 switch ( errno ) {
601 case EPERM:
602 case EACCES:
603 error(KIO::ERR_ACCESS_DENIED, path);
604 break;
605 case ENOSPC:
606 error(KIO::ERR_DISK_FULL, path);
607 break;
608 default:
609 error(KIO::ERR_CANNOT_CHOWN, path);
610 }
611 } else
612 finished();
613}
614
615void FileProtocol::stat( const KUrl & url )
616{
617 if (!url.isLocalFile()) {
618 KUrl redir(url);
619 redir.setProtocol(config()->readEntry("DefaultRemoteProtocol", "smb"));
620 redirection(redir);
621 kDebug(7101) << "redirecting to " << redir.url();
622 finished();
623 return;
624 }
625
626 /* directories may not have a slash at the end if
627 * we want to stat() them; it requires that we
628 * change into it .. which may not be allowed
629 * stat("/is/unaccessible") -> rwx------
630 * stat("/is/unaccessible/") -> EPERM H.Z.
631 * This is the reason for the -1
632 */
633 const QString path(url.path(KUrl::RemoveTrailingSlash));
634 const QByteArray _path( QFile::encodeName(path));
635 const QString sDetails = metaData(QLatin1String("details"));
636 const int details = sDetails.isEmpty() ? 2 : sDetails.toInt();
637
638 UDSEntry entry;
639 if ( !createUDSEntry( url.fileName(), _path, entry, details, true /*with acls*/ ) )
640 {
641 error(KIO::ERR_DOES_NOT_EXIST, path);
642 return;
643 }
644#if 0
646 MetaData::iterator it1 = mOutgoingMetaData.begin();
647 for ( ; it1 != mOutgoingMetaData.end(); it1++ ) {
648 kDebug(7101) << it1.key() << " = " << it1.data();
649 }
651#endif
652 statEntry( entry );
653
654 finished();
655}
FileProtocol::symlink
virtual void symlink(const QString &target, const KUrl &dest, KIO::JobFlags flags)
Definition: file_unix.cpp:481
FileProtocol::rename
virtual void rename(const KUrl &src, const KUrl &dest, KIO::JobFlags flags)
Definition: file_unix.cpp:419
FileProtocol::close
virtual void close()
Definition: file.cpp:523
FileProtocol::listDir
virtual void listDir(const KUrl &url)
Definition: file_unix.cpp:309
FileProtocol::del
virtual void del(const KUrl &url, bool isfile)
Definition: file_unix.cpp:521
FileProtocol::chown
virtual void chown(const KUrl &url, const QString &owner, const QString &group)
Definition: file_unix.cpp:566
FileProtocol::stat
virtual void stat(const KUrl &url)
Definition: file_unix.cpp:615
FileProtocol::chmod
virtual void chmod(const KUrl &url, int permissions)
Definition: file.cpp:187
FileProtocol::copy
virtual void copy(const KUrl &src, const KUrl &dest, int mode, KIO::JobFlags flags)
Definition: file_unix.cpp:78
FileProtocol::read
virtual void read(KIO::filesize_t size)
Definition: file.cpp:461
KIO::SlaveBase::metaData
QString metaData(const QString &key) const
KIO::SlaveBase::processedSize
void processedSize(KIO::filesize_t _bytes)
KIO::SlaveBase::warning
void warning(const QString &msg)
KIO::SlaveBase::finished
void finished()
KIO::SlaveBase::mOutgoingMetaData
MetaData mOutgoingMetaData
KIO::SlaveBase::redirection
void redirection(const KUrl &_url)
KIO::SlaveBase::error
void error(int _errid, const QString &_text)
KIO::SlaveBase::statEntry
void statEntry(const UDSEntry &_entry)
KIO::SlaveBase::listEntry
void listEntry(const UDSEntry &_entry, bool ready)
KIO::SlaveBase::totalSize
void totalSize(KIO::filesize_t _bytes)
KIO::SlaveBase::config
KConfigGroup * config()
KIO::UDSEntry
KIO::UDSEntry::UDS_LINK_DEST
UDS_LINK_DEST
KIO::UDSEntry::UDS_FILE_TYPE
UDS_FILE_TYPE
KIO::UDSEntry::UDS_NAME
UDS_NAME
KIO::UDSEntry::insert
void insert(uint field, const QString &value)
KIO::UDSEntry::clear
void clear()
KMountPoint::List::findByPath
Ptr findByPath(const QString &path) const
KMountPoint::SupportsChmod
SupportsChmod
KMountPoint::currentMountPoints
static List currentMountPoints(DetailsNeededFlags infoNeeded=BasicInfoNeeded)
KSharedPtr
KUrl
KUrl::RemoveTrailingSlash
RemoveTrailingSlash
KUrl::url
QString url(AdjustPathOption trailing=LeaveTrailingSlash) const
KUrl::path
QString path(AdjustPathOption trailing=LeaveTrailingSlash) const
KUrl::setProtocol
void setProtocol(const QString &proto)
KUrl::isLocalFile
bool isLocalFile() const
KUrl::fileName
QString fileName(const DirectoryOptions &options=IgnoreTrailingSlash) const
KUrl::toLocalFile
QString toLocalFile(AdjustPathOption trailing=LeaveTrailingSlash) const
write_all
int write_all(int fd, const char *buf, size_t len)
Definition: file.cpp:379
MAX_IPC_SIZE
#define MAX_IPC_SIZE
Definition: file.cpp:94
file.h
write_all
int write_all(int fd, const char *buf, size_t len)
Definition: file.cpp:379
same_inode
static bool same_inode(const KDE_struct_stat &src, const KDE_struct_stat &dest)
Definition: file_unix.cpp:67
kDebug
#define kDebug
kWarning
#define kWarning
readEntry
KAutostart::StartPhase readEntry(const KConfigGroup &group, const char *key, const KAutostart::StartPhase &aDefault)
kconfiggroup.h
perror
QDebug perror(QDebug s, KDebugTag)
kdebug.h
i18n
QString i18n(const char *text)
kmountpoint.h
KIO
KIO::Overwrite
Overwrite
KIO::filesize_t
qulonglong filesize_t
KIO::ERR_SLAVE_DEFINED
ERR_SLAVE_DEFINED
KIO::ERR_IDENTICAL_FILES
ERR_IDENTICAL_FILES
KIO::ERR_DOES_NOT_EXIST
ERR_DOES_NOT_EXIST
KIO::ERR_COULD_NOT_WRITE
ERR_COULD_NOT_WRITE
KIO::ERR_DIR_ALREADY_EXIST
ERR_DIR_ALREADY_EXIST
KIO::ERR_WRITE_ACCESS_DENIED
ERR_WRITE_ACCESS_DENIED
KIO::ERR_FILE_ALREADY_EXIST
ERR_FILE_ALREADY_EXIST
KIO::ERR_CANNOT_OPEN_FOR_READING
ERR_CANNOT_OPEN_FOR_READING
KIO::ERR_CANNOT_ENTER_DIRECTORY
ERR_CANNOT_ENTER_DIRECTORY
KIO::ERR_COULD_NOT_READ
ERR_COULD_NOT_READ
KIO::ERR_ACCESS_DENIED
ERR_ACCESS_DENIED
KIO::ERR_CANNOT_RENAME
ERR_CANNOT_RENAME
KIO::ERR_CANNOT_CHOWN
ERR_CANNOT_CHOWN
KIO::ERR_IS_FILE
ERR_IS_FILE
KIO::ERR_COULD_NOT_RMDIR
ERR_COULD_NOT_RMDIR
KIO::ERR_IS_DIRECTORY
ERR_IS_DIRECTORY
KIO::ERR_CANNOT_SYMLINK
ERR_CANNOT_SYMLINK
KIO::ERR_DISK_FULL
ERR_DISK_FULL
KIO::ERR_CANNOT_DELETE
ERR_CANNOT_DELETE
KIO::ERR_UNSUPPORTED_ACTION
ERR_UNSUPPORTED_ACTION
KIO::ERR_CANNOT_OPEN_FOR_WRITING
ERR_CANNOT_OPEN_FOR_WRITING
group
group
remove
KGuiItem remove()
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIOSlave

Skip menu "KIOSlave"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal