does gvfsd-mtp support the POSIX API `rename`?
- From: "oucaijun happy 163 com" <oucaijun happy 163 com>
- To: gvfs-list <gvfs-list gnome org>
- Subject: does gvfsd-mtp support the POSIX API `rename`?
- Date: Thu, 03 Dec 2020 04:12:05 -0000
Hi,
I failed to used QFile::rename (in fact it called POSIX API `rename`) to rename the file/directory of android mobile.
```c++
QString mtpDirPath = "/run/user/1000/gvfs/mtp:host=HUAWEI_VOG-AL00_MQS0220407000985/内部存储/Test/";
bool t_rename_mtp()
{
//Returns true if successful; otherwise returns false.
QString src = "" + "dir00";
QString dest = mtpDirPath + "dir01";
QFile from(src);
bool ret = from.rename(dest); // FAILED
return ret;
}
```
ENV:
* CPU : `Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz `
* MOBILE : `华为 P30 Pro(VOG-AL00)` `华为 nova5 Pro(SEA AL10)`
* `libmtp-dev`: `1.1.16-2`
* `gvfs`: `1.38.1-5`
* `qtbase5-dev`: `5.11.3.28-1+eagle`
* `libglib2.0-0`:`2.58.3.4-1+deepin`
* `libglib2.0-bin`:`2.58.3.4-1+deepin`
By reading the source code of gvfs 1.38.1-5 and glib2.0-2.58.3.4, I found the `move`(POSIX `rename`) and g_file_set_display_name (GIO API) are both realized in gvfs(mtp backend) and gio.
I am not sure whether I understood the code correctly, also I failed to debug the gio code for running error.
Could you kindly tell me the truth? Thank you!
[Date Prev][Date Next] [Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]