Hi, I am needing to have the Pathnames and Size of the “image” files that are located under C:\Users.
With the following query I get the pathnames, but I don’t know how to concatenate with the “sizes”
(pathnames of files whose ((name of it as lowercase ends with “.jpg” as lowercase)) of (descendant folders of folder “C:\Users” ))
A: C:\Users\xxxx\Desktop\New folder\users.jpg
ideal would be:
A: C:\Users\xxxx\Desktop\New folder\users.jpg - 10Kb
Don’t use this in Fixlet relevance! ‘descendant files’ is very prone to causing problems because it requires a lot of resource and time to walk the disk. At best, make it an ActionScript that runs and creates an output file; at worst, an Analysis Property to only evaluate daily or weekly, and not in every client loop.
((pathname of it, size of it) of files whose ((name of it as lowercase ends with “.jpg” as lowercase)) of (descendant folders of folder “C:\Users” ))
1 Like
Jason, thank you very much!
Do you know if there is something where to put “all image extensions”? for example, jpg, png, ico, etc.
On the other hand, the value of “sizes” is in bytes, could it be passed to Kb?
I’d probably switch to ‘find files’ instead of ‘files whose()’
‘find files’ takes shell-type wildcards, is not case-sensitive, and doesn’t have to loop through every file like a files whose()
We can also take the size of it / 1024
, but anything smaller than 1 KB would then appear to be ‘0’ so we can handle that by replacing it with ‘1’ for anything 1 KB or smaller…
q: ((pathname of it, maximum of (1; size of it / 1024)) of find files ("*.jpg";"*.png") of descendant folders of folder "C:\Test" )
A: C:\Test\dir1\test.jpg, 1
A: C:\Test\dir1\test.png, 1
A: C:\Test\dir2\TEST3.JPG, 1
T: 3.468 ms
I: plural ( string, integer )
2 Likes