FileTools : Some tools to work with files

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.

I mean there is not any other method to get path to external storage.
/storage/emulated/0/ and /sdcard do not work on all phones and /mnt/sdcard works but some components don’t support it.

1 Like
  • There is no path /storage/sdcard/.
  • On which devices / Android versions does this path not work: /storage/emulated/0/? (*)
    I do not know any.

(*) The “/storage/emulated/” folder does not really exist. It’s what might be called a “symbolic link”, or, in simpler terms, a reference to where the real data is stored.

See also here: