Search the Community
Showing results for tags 'dirgetsize'.
I'm working on a script to copy a subset of files and folders from a PC to a server. I'm using the extended info from DirGetSize to show how many files and folders and total size that will be copied (copy being done by RoboCopy). Then I run DirGetSize against the destination when the copy is done to compare against the DirGetSize from the copy source so I can know if anything got skipped. I'm finding that a lot of stuff is getting skipped. This lead me to realize that it's because DirGetSize is including files and folders that are hidden and/or system, and I'm excluding these in RoboCopy.
Here is my _DirGetSizeEx function. It allows you to get the size of a directory, with additional filters for including, excluding files and folders. ; #FUNCTION#==================================================================================================================== ; Name ..........: _DirGetSizeEx ; Description ...: Returns the size in bytes of a file list by extension. ; Syntax ........: _DirGetSizeEx($sDir[, $sMask = "*"[, $iFlag = 0]]) ; Parameters ....: $sDir - The directory to search in. ; $sMask - [optional] Filter f