File-System getEntity --> How do i check if entity is Folder or File?


When i loop through the entities in a folder i get all files and folders. But I cant distinguish between files and folders.
i have tried checking it with file.exists (but both give true).
any ideas ?

if (!fs.Folder.exists(entity.path))
isFile = true;

please try to enter the path of the folder or file here (entity.path)

if it is not folder then it file.


fs is filesystemModule Nativescript

import * as fs from "tns-core-modules/file-system/file-system";


Thank you. I thought i tried this, but got true in both cases. I must have forgotten o reset the isFIle :frowning: above solution works.