All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH obexd 1/3] client: add FileTransfer.MoveFile implementation
@ 2011-08-12 12:46 Luiz Augusto von Dentz
  2011-08-12 12:46 ` [PATCH obexd 2/3] client: add FileTransfer.CopyFile implementation Luiz Augusto von Dentz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2011-08-12 12:46 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

---
 client/ftp.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/client/ftp.c b/client/ftp.c
index e81d443..4c04eda 100644
--- a/client/ftp.c
+++ b/client/ftp.c
@@ -316,6 +316,25 @@ static DBusMessage *copy_file(DBusConnection *connection,
 static DBusMessage *move_file(DBusConnection *connection,
 				DBusMessage *message, void *user_data)
 {
+	struct ftp_data *ftp = user_data;
+	struct obc_session *session = ftp->session;
+	GwObex *obex = obc_session_get_obex(session);
+	const char *filename, *destname;
+	int err;
+
+	if (dbus_message_get_args(message, NULL,
+				DBUS_TYPE_STRING, &filename,
+				DBUS_TYPE_STRING, &destname,
+				DBUS_TYPE_INVALID) == FALSE)
+		return g_dbus_create_error(message,
+				"org.openobex.Error.InvalidArguments", NULL);
+
+	if (gw_obex_move(obex, filename, destname, &err) == FALSE) {
+		return g_dbus_create_error(message,
+				"org.openobex.Error.Failed",
+				"%s", OBEX_ResponseToString(err));
+	}
+
 	return dbus_message_new_method_return(message);
 }
 
-- 
1.7.6


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-08-22  7:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-12 12:46 [PATCH obexd 1/3] client: add FileTransfer.MoveFile implementation Luiz Augusto von Dentz
2011-08-12 12:46 ` [PATCH obexd 2/3] client: add FileTransfer.CopyFile implementation Luiz Augusto von Dentz
2011-08-12 12:46 ` [PATCH obexd 3/3] Add move and copy support to ftp-client Luiz Augusto von Dentz
2011-08-22  7:37 ` [PATCH obexd 1/3] client: add FileTransfer.MoveFile implementation Johan Hedberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.