IO

File manipulation

  io.file.delete test.txt // also io.file.remove and io.file.erase
  io.file.join test.txt test1.txt test2.txt … //
  io.file.copy
  io.file.move
  io.file.rename

File list (Note: File list use Dir list to find files)

  io.files.clear // clear list
  io.files.new *.* // also io.files
  io.files.add *.txt // add files to list
  io.files.sub test.txt // delete file from list
  io.files.subweak test // delete files (with pattern) from list

  io.files.first // go to first entry – see also io.files.get…
  io.files.next // go to next entry – see also io.files.get…
  io.files.sort
  io.files.sortreal // also io.files.number
  io.files.flip // flip order

  io.files.replacetxt ‘old’ ‘new’ // replace in files pattern ‘old’ into ‘new’

// the following variables are filled with files.first (automatically for each list change) and files.next
  io.files.get // full reference
  io.files.getfile // only full filename (test.txt)
  io.files.getdir // only directory (folder)
  io.files.getname // only filename (test)
  io.files.getextension // only extension (txt)
  io.files.length

Directory manipulation

  io.dir.make folder1
  io.dir.delete folder1 // also io.dir.remove or io.dir.erase
  io.dir.copy
  io.dir.rename
  io.dir.change
  io.dir.hardchange // change folder, if it not exists it would be created

Directory (folder) list

  io.dirs.clear // clear list
  io.dirs.new a* // also io.dirs
  io.dirs.add b* // add folders to list
  io.dirs.complete /a/ // complete dirs
  io.dirs.complete.add /b/ // add folders to list
  io.dirs.sub folder1 // delete directory from list
  io.dirs.subweak // delete folders (with pattern) from list

  io.dirs.first // go to first entry – see also io.files.get…
  io.dirs.next // go to next entry – see also io.files.get…
  io.dirs.sort
  io.dirs.sortreal // also io.dirs.number
  io.dirs.flip // flip order

  io.dirs.rnew a* // fill list with folder (recursive)
  io.dirs.radd b* // add folders (recursive) to list

// the following variables are filled with dirs.first (automatically for each list change) and dirs.next
  io.dirs.get
  io.dirs.length

Examples

io.dirs.clear
io.files * // load all files into a file list
  // you can use io.files.add to add more files to the file list

for io.files.length // for all files
  print io.workdir / io.files.getdir / io.files.getfile
  io.files.next
end

io.dirs.complete * // load all sub dirs into a dir list
  // you can use io.dirs.add to add more dirs to the dir list
io.files * // load all files from sub dirs into a file list
  // you can use io.files.add to add more files to the file list

for io.files.length // for all files
  print io.workdir / io.files.getdir / io.files.getfile
  io.files.next
end