does gvfsd-mtp support the POSIX API `rename`?



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`


I read https://wiki.gnome.org/Projects/gvfs/backends to know that mtp backend do not surpport the move job. But seems the code say something different!

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!


oucaijun happy 163 com


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]