J jcmartini Member Licensed User Longtime User Apr 23, 2022 #1 I am using the "SaveAs" snippet mentionned in: https://www.b4x.com/android/forum/t...-folder-list-of-other-related-methods.129897/ . That's work fine for me except one point: Files saved cannot be deleted in the screen where we saved it and I notice with ftp that the saved file has the 644 attribute (rw-r--r--). So, I cannot delete this saved file. Is somebody knows how to change this attribute at copy time ?
I am using the "SaveAs" snippet mentionned in: https://www.b4x.com/android/forum/t...-folder-list-of-other-related-methods.129897/ . That's work fine for me except one point: Files saved cannot be deleted in the screen where we saved it and I notice with ftp that the saved file has the 644 attribute (rw-r--r--). So, I cannot delete this saved file. Is somebody knows how to change this attribute at copy time ?
Erel B4X founder Staff member Licensed User Longtime User Apr 24, 2022 #2 How are you trying to delete the files? Android abstracts the file system. You are not expected to modify or check these attributes. Upvote 0
How are you trying to delete the files? Android abstracts the file system. You are not expected to modify or check these attributes.
J jcmartini Member Licensed User Longtime User Apr 24, 2022 #3 I try to delete it with: B4X: If File.Exists(MyDir, FileName) = True Then Log("File exists. I'll try to delete it...") If File.Delete(MyDir, FileName) = False Then Log("File has NOT been deleted...") Else Log("File has been deleted...") End If End If File is never deleted and I don't receive any error message or abend. In my application I want to have only the last copy of my file (a SQLite database): new copy should replace the previous one. Actually each save file, with an index, is added in destination folder. I tried to delete it with FTP without success. I also tried to change the owner and the attributes of the file without more success. Upvote 0
I try to delete it with: B4X: If File.Exists(MyDir, FileName) = True Then Log("File exists. I'll try to delete it...") If File.Delete(MyDir, FileName) = False Then Log("File has NOT been deleted...") Else Log("File has been deleted...") End If End If File is never deleted and I don't receive any error message or abend. In my application I want to have only the last copy of my file (a SQLite database): new copy should replace the previous one. Actually each save file, with an index, is added in destination folder. I tried to delete it with FTP without success. I also tried to change the owner and the attributes of the file without more success.
DonManfred Expert Licensed User Longtime User Apr 24, 2022 #4 To less information. What is the value of MyDir Upvote 0
J jcmartini Member Licensed User Longtime User Apr 24, 2022 #5 "/storage/emulated/0/Fichiers/MyDB" Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Apr 25, 2022 #6 Your code cannot work. You should use ExternalStorage library to delete external files. Upvote 0