The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
global dirCnt # Declare these variables as global so they
global fileCnt # can be used in the main code.
# Read recursively through the top, counting directories and files, totaling the
# file space used and printing the directory or file name to stdout.
for (root, dirs, files) in walkdir(topDir) # walkdir function returns tuples
for dir in dirs # Count directories i
aDir = joinpath(root, dir) # Create fule path name--same as "root * '/' * dir"
dirCnt += 1
println("Directory # ", dirCnt, " = ", aDir)
for file in files # Count files and total file sizes.
if ((file == ".") || (file == ".."))
if (endswith(file, ".md")) # Select only files with a suffix of "".md"
fileCnt += 1
fn = joinpath(root,file)
sz = stat(fn).size # Get file permissions and file size
totalSize += sz
println("File # ", fileCnt, " = ", fn, ", size = ", sz)
# Main processing in this module
dirCnt = 0
fileCnt = 0
totalSize = 0
subDir = ".julia"
println("Starting directory processing")
println("Directories = ", dirCnt, ", Files = ", fileCnt, ", Total size = ", totalSize)
IMHO, needing to keep your statement confined to a single line gives me more of a 1970's feel, than anything elegant. I don't feel like a lack of semicolons is a help, and it's one of the things I like least about Python.
My mother was a teacher of history, lecturing about WW2 13-15 yo. She recommended the kids to watch the British "A family at war" series (so this is long ago!). She also loved singing, and teaching the class to sing "We'll meet again" came without saying. The name of Vera Lynn came up in one of the TV episodes, one guy referring to the lady as "the singing soldier wh*re". In the history lesson the following day, my mother had to explain a few things to the kids