FileTools : Some tools to work with files

Simply you can’t (Learn Why?)
But you can do this:

And thank you @DevYB for giving me an awesome idea.

finally I got something to work on during this boring and lonelyfull lockdown :sweat_smile:

3 Likes

one time download file?
it is possible?
can you please explain with blocks image

Yes it is possible.
You have to check that file exists or not.If it does not exists then download it else proceed.

5 Likes

can you create blocks for me
please help
i need want just blocks image

Can I know what you have tried from yourself?

2 Likes

when I use the FilelistAsync method the application closes

1 Like

Thank you.
Can you please check copyfileasync and movefileasync methods?

1 Like

With movefileasync it closes

Thank you @e_sorrentino72
Now I found the problem.
Actually this is because of AsynchUtil class from AI.
I am finding another way to run tasks in background.
Hope this will be fixed soon!

1 Like

with copyfilesync the file is copied to the destination but the application closes

1 Like

Another note or inconsistency: @vknow360 @Taifun

2 Likes

I think that’s not a bug.It is bacause of using relative path.
/storage/emulated/0/ returns true because it is your external storage and extension thinks every directory starting with / is either external storage itself or exists in external storage.As we all know / refers to external storage.Even if you will use / then it will return same result.

I didn’t say it was a bug, I was just talking about an inconsistency.
However, the path to the root directory of the external storage
/storage/emulated/0/
is not a relative path, but an absolute path.

1 Like

You are right.
But the problem is that FileTools uses relative file path system.
So ‘/’ refers to external storage and ‘//’ refers to assets directory.

1 Like

Yes, but also the absolute path:

2 Likes

Because if a filename starts with external storage path then it does not modifies that.
For example:
/MyDir >> /storage/emulated/0/MyDir
/storage/emulated/0/MyDir >> /storage/emulated/0/MyDir

1 Like

Yes, I am aware of that.

Btw, I’m not a fan of relative paths at all. They only bring trouble and confusion. See for example the File component:


There the relative and sometimes the absolute path is used. Why not do it consistently in the same way everywhere?

1 Like

I too don’t like using relative path in my extensions but if I shall not then users have to use a file extension to get path of external storage.
That’s why when I had released FileTools it was using absolute path system.

@Taifun can answer it betterly.

Btw , community’s mysterious notification bug is here :space_invader:

1 Like

Please help me I have PM you concerning this issue.

Sorry, but this explanation is somewhat opaque.