1.Introduction
Description: The name of extension is FileTools and features are similar to its name.
It provides tools to work with Files and Folders.
Latest Version: 10.1
Last Updated: 2021-10-08T18:30:00Z
2.Blocks
3.Documentation
Returns path to application specific directory
Thanks to @bodymindpower for suggesting changes
Returns a list of available storage directories.
Copies file from source to destination folder.
Copies file from source to destination asynchronously.Use this to copy big files to avoid runtime errors.
Creates Application Specific Directory in case it does not exists
Creates a single directory.It triggers âDirectory Createdâ with boolean
true
orfalse
Deletes given file or folder.If it is directory then all subdirectories will be deleted and this can take some time.It triggers âFileDeletedâ event with boolean
true
orfalse
.
Returns true if file or folder exists else false
Returns files list from given directory (if it exists) .Use file extension as filter like mp3,txt,etc.If you donât want to use filter then use empty string.Also if donât want to get subdirectories then set âwithFoldersâ to false else true.If recursive is set to true then it will also get files from subdirectories recursively.
Works same as FilesList but it gets file list asynchronously which denies any oppertunity of runtime error in getting files list from a directory having so much files.It raises âGotFileListâ event with files list.
Returns file list from assets
Returns file name from path if it exists
Returns current size of file or folder
Returns file path from file name.In this case it will return /storage/sdcard/mFile.txt
Returns folders list of given directory
Returns free size of directory in bytes.
Note: it uses absolute file Path
Converts file path to content uri
Moves file from source to destination asynchronously.
Checks that given path is complete path or not
For example: /testt.txt and /mnt/sdcard/Android/com.sunny.notez/files/testt.txt are not same.
Returns that folder/file is executable or not
Returns true if path is file else false
Returns true if file/folder is hidden else false
Returns true if file/folder is readable else false
Returns true if file/folder is writable else false
Last modified time of file/folder in given format
Mime type of given file.In above case it will return text/plain
Moves file from source to destination and deletes source file
Converts content uri to file path
Renames file without deleting it
Returns total space of directory
Note: it uses absolute file Path
4.Downloads
Aix
Here are two download links for Aix and Aia:
Download link 1:
com.sunny.FileTools.aix (31.8 KB)
Download link 2: com.sunny.FileTools.aix - Google Drive
Aia
Download Link1: FileTools.aia (51.7 KB)
Download Link2: FileTools.aia - Google Drive
AIA does not have latest version of extension
5.Credits
It was not only me who was included in making this extension.
A lot of people helped me to make this extension.
I want to say thank you @Deepanshu_Arya and @hammerhai for helping me in making FileTools
Also I am very thankful to App Inventor as AI source files helped me very much in adding new methods
StackOverFlow also helped me a lot in making FileTools
And a lot of thanks to @KodularCreator for this awesome platform
Honorable mention:
@bodymindpower for reporting some bugs and changes
6.Updates/Bug Fixes
ChangeLog Version2
New blocks
Added two new blocks
Bug Fixes
- All methods returning files list will now return empty list(if files list is empty) instead of runtime error
- Mime Type method will return mime type with more accuracy.
- Fixed some null pointer exceptions
ChangeLog Version3
New blocks
Added three new blocks
Changes
New version includes changes in some blocks
- âApplication Specific Directoryâ now returns path to ASD
- Replaced âFileâ with âFileSystemsâ in âAvailable Storage Directoryâ block but I am not sure it is working or not
Bug Fixes
- Some changes in âAvailable Storage Directoryâ block
ChangeLog Version4
New blocks
Added 6 new blocks:
Changes
- Replaced path with name.Now it will find path from file name (Thanks to App Inventor)
- Some other minor changes
Bug Fixes
- Now it is able to copy files from assets (Thanks @bodymindpower)
- âAvailableStorageDirectoriesâ blocks is working now (Thanks @salem_m_s2021)
ChangeLog Version5
Changes
- Added ârecursiveâ in FilesList and FileListAsync
Bug Fixes
- Fixed bug in Delete method
- Fixed bug in getting assets list using FilesList.Use
//
in FilesList as dir to get Assets list while using Companion - Some minor bug fixes
ChangeLog Version6
Changes
- Removed some un-neccessary methods and imports which reduced aix size (40 kb to 31kb)
- Some internal changes like using empty string in any path socket will also return an empty string
- Fixed several spelling and grammar mistakes
ChangeLog Version7
Bug Fixes
- Fixed bug in
FileListFromAssets
method
ChangeLog Version8
Bug Fixes
- Fixed bug in
FileListAsync
,CopyFileAsync
andMoveFileAsync
Thanks to @palmare_as and @e_sorrentino72
Changes
- Some internal changes and fixed spelling and grammar mistakes
ChangeLog Version9
Bug Fixes
- Fixed bug in
CopyFile
andCopyFileAsync
methods which were not copying file from assets - Fixed bug in
IsFile
method which was returning false for every assetâs file
Changes
- Some internal changes
- Removed some un-necessary libraries
ChangeLog Version10
Changes
- Extension will not work in Kodular Companion for asset files
For example,//foto.png
will refer to/storage/emulated/0/AppInventor/assets/foto.png
(Android < 10) -
FileList
andFileListAsync
now have multi filter support (separated by,
) - Some internal changes
Bug Fixes
-
PathFromUri
is now compatible with Android >= 10
ChangeLog Version10.1
- Fixed bug in
IsFile
method which was not working for Asset files.
It was affecting copy and move operations.