FileTools : Some tools to work with files

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:

Micromax Q336 running on Android 4.4
Instead of that /storage/sdcard0 works for me.

I typed that in misconception.I actually wanted to type /sdcard

1 Like

This path does not exist either: /sdcard/.

/storage/sdcard0/ points to /storage/emulated/0/ and therefore the latter should actually work on all Android versions and devices.

I am not sure but I have seen that path as external storage in virtual box.

If it is true then I can now remove relative file path system from my extensions.
Thank you @bodymindpower

2 Likes

this can be done in a perfect world, but this world is not perfect… :upside_down_face:
Taifun

1 Like

The whole world has been talking about standards for many years. So why can’t this be standardized in such a simple case? You don’t need a perfect world for that.

I really don’t know how many (actually unnecessary) questions (to the correct paths) I have already answered in the AI2 and Kodular forum.

1 Like

ChangeLog Version8

Bug Fixes

Changes

  • Some internal changes and fixed spelling and grammar mistakes
3 Likes

component_method

good evening is this component deprecated?
I don’t know if the image looks good, it refers to the .ext

Hi @e_sorrentino72
Which block are you using?

2 Likes

.extention