#include <gtk/gtk.h>
#include <glib/gi18n.h>
-#include <glib/gstdio.h> /* g_unlink () */
#include <gio/gio.h> /* g_file_trash () */
#include <libtransmission/transmission.h> /* TR_RATIO_NA, TR_RATIO_INF */
#include <stdlib.h> /* bsearch (), qsort () */
#include <string.h>
-#include <unistd.h> /* unlink () */
+#include <unistd.h> /* close () */
#ifdef WIN32
#include <w32api.h>
blocklistDelete (tr_blocklistFile * b)
{
blocklistClose (b);
- unlink (b->filename);
+ tr_remove (b->filename);
}
/***
#include <string.h> /* strlen () */
#include <sys/types.h>
-#include <unistd.h> /* unlink, stat */
+#include <unistd.h> /* stat */
#include <event2/buffer.h>
char * filename;
filename = getTorrentFilename (session, inf);
- unlink (filename);
+ tr_remove (filename);
tr_free (filename);
}
* $Id$
*/
-#include <unistd.h> /* unlink */
-
#include <string.h>
#include "transmission.h"
tr_torrentRemoveResume (const tr_torrent * tor)
{
char * filename = getResumeFilename (tor);
- unlink (filename);
+ tr_remove (filename);
tr_free (filename);
}
#include <errno.h>
#include <stdlib.h> /* strtol */
#include <string.h> /* strcmp */
-#include <unistd.h> /* unlink */
#ifdef HAVE_ZLIB
#include <zlib.h>
tr_snprintf (result, sizeof (result), "success");
}
- unlink (filename);
+ tr_remove (filename);
tr_free (filename);
tr_free (buf);
}
removeEmptyFoldersAndJunkFiles (tr_ptrArrayNth (&folders, i));
/* cleanup */
- rmdir (tmpdir);
+ tr_remove (tmpdir);
tr_free (tmpdir);
tr_ptrArrayDestruct (&folders, tr_free);
tr_ptrArrayDestruct (&files, tr_free);
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <unistd.h> /* stat (), getcwd (), getpagesize (), unlink () */
+#include <unistd.h> /* stat (), getcwd (), getpagesize () */
#include <event2/buffer.h>
#include <event2/event.h>
if (bytesLeft != 0)
return -1;
- unlink (oldpath);
+ tr_remove (oldpath);
return 0;
}
#endif
#include <locale.h> /* setlocale() */
-#include <unistd.h> /* write(), unlink() */
+#include <unistd.h> /* write() */
#include <event2/buffer.h>
{
tr_logAddError (_("Couldn't save temporary file \"%1$s\": %2$s"), tmp, tr_strerror (err));
tr_close_file (fd);
- unlink (tmp);
+ tr_remove (tmp);
}
else
{
{
err = errno;
tr_logAddError (_("Couldn't save file \"%1$s\": %2$s"), filename, tr_strerror (err));
- unlink (tmp);
+ tr_remove (tmp);
}
}
}