Ha, I see what you mean, but it is a user error, not the scripts'.

You're saying $nofile(dump) will return $null, therefore $isdir($null) will be $false, hence the negated of that is $true, making the script to return.

If we dont have a folder named dump, this forms no problem, but if we had a folder named dump, it still would have thought theres no such folder. However, the user error lies in the fact that "dump" isn't a folder path, but a file name. If the user wishes to put the output in folder dump, they should specify dump\, which $nofile wont strip, hence $isdir will give $true, and the negated false, so that the script continues.

Since the user is responsible for entering both the folder and filename, just putting 'dump' as output, actually seems like a good reason to give an error, since only the filename (dump) is recognised, even if the user meant for it to be a folder.

My confusion with your remark thus was the fact that from my point of view, putting just 'dump' should raise an error. However, our views on it don't necessarily need to be the same. Anyone is free to modify the given code smile

Greets