PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 2024 → fdelete/frename do not work
fdelete/frename do not work
Débuté par Luis DEVIS DABAN, 29 juin 2017 18:51 - 2 réponses
Membre enregistré
18 messages
Posté le 29 juin 2017 - 18:51
I use Windev mobile v 20.

I'm accessing to the phone SD card folder from my PC (windows10) and put via USB a file that has to be read by my Android App. After reading the file my App has to delete it.

Problems:

I use two diferent devices o phones

In one of them everything works fine, the sdcard is detected as sdcard1 (using SysDirStorageCard() ) and the file can be read, deleted or even renamed.

In the other device, WITH THE SAME CONFIGURATION, SysDirStorageCard() returns sdcard0 and I have to use manually the name sdcard1 to be able to read the files sent from my PC via USB. Besides the fdelete(), frename() functions do not work, they just do not give any error but don't delete nor rename the file either.

Any idea on what's wrong?

Thankyou Thankyou Thankyou Thankyou
Posté le 30 juin 2017 - 01:17
Hi Luis,

the permissions scheme used in android has changed with time, so this
kind of problems is quite frequent...

Use google to have a better idea and find if there is any place where
the permissions are the same in all versions of android, as that may not
be the case.

I prefer to go around this kind of problems by using a different method:
the app is requesting the needed file from a server using ftp, http, or
even sockets, then writes the file down if needed inside it's protected
area (ie the work/current directory) or process the data directly
without even writing it.

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com

Le 6/29/2017 à 10:51 AM, Luis DEVIS DABAN a écrit :
I use Windev mobile v 20.

I'm accessing to the phone SD card folder from my PC (windows10) and put
via USB a file that has to be read by my Android App. After reading
the file my App has to delete it.
Problems:

I use two diferent devices o phones
In one of them everything works fine, the sdcard is detected as sdcard1
(using SysDirStorageCard() ) and the file can be read, deleted or even
renamed.

In the other device, WITH THE SAME CONFIGURATION, SysDirStorageCard()
returns sdcard0 and I have to use manually the name sdcard1 to be able
to read the files sent from my PC via USB. Besides the fdelete(),
frename() functions do not work, they just do not give any error but
don't delete nor rename the file either.

Any idea on what's wrong?

Thankyou Thankyou Thankyou Thankyou
Membre enregistré
18 messages
Posté le 30 juin 2017 - 16:17
Thank you Fabrice,
Actually the versions of Android are not exactly the same, not too different but could be the cause.
I'll have a look into that.

Thank you very much.