An easy way to access files/folders/directories with Julia in command line based on language: batch-script

What I don’t understand it’s why you would do this with a readline and a bunch of string comparisons instead of just readdir directly?

A couple of tips anyway:

  • Try to name functions and variables a bit more self-explanatorily, batchscript, filesystem, parameter and filepath are all a bit opaque
  • Instead of chaining x == "a" || x == "b" || ..., you can use x in ("a", "b", ...)
  • readdir is (to best effort) OS agnostic, so you don’t need to check
  • Comments are good, but a comment that tells you which function is called on the next line doesn’t really add any information
1 Like