By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to? Can @DU function in 4Utils64 plugin somehow cater for dirs with spaces?

Hi all.

I'm trying to write a script to display the disk space used individually by all the games I have installed. I want to see the allocated space so that I know accurately how much space will be recovered if I uninstall a particular game.

Unfortunately, the @FILESIZE function is bugged when you ask it to return allocated space, so I'm looking for alternatives.

After researching plugins, I came across vefatica's 4UTILS64 plugin and installed it. I'm trying to use the @DU function to return allocated space and it seems to work fine, but only if the directory name has no spaces in it. For directories with spaces, the function seems to have a problem and always returns "-1".

echo %@du[f12013,ra]
9196498944   <---- This is correct. For the game F1 2013, DIR /s also reports 9,196,498,944 bytes allocated.

echo %@du[path of exile,ra]

echo %@du["path of exile",ra]
-1           <---- Incorrect. For Path of Exile, DIR /s reports 31,835,172,864 bytes allocated.

Is there some way I can adjust the syntax with @DU to allow it to process directories containing spaces? I think I've tried just about every possible combination:
echo %@du[path of exile,ra]
echo %@du["path of exile",ra]
echo %@du[path of exile\*,ra]
echo %@du["path of exile\*",ra]

Ha! Believe it or not, while writing this post I've been double-checking the syntax of the above code statements by running them again in a command-line window. I think I've found a workaround. If I type....
cd "path of exile"
echo %@du[.,ra]

I get the right result. So it looks like I can get my script working with a little editing. But I would still like to know if there's a way to use the directory name directly with @DU, as it seems a little inconsistent for it to work with some directories but not others.

Thanks for any help offered.

Similar threads