## nanoTools.awk
#
BEGIN {
	remove("W:/", "root")
	remove("Z:/", "root")

	pfx = "D:/X"
	tree(pfx "/*.txt", "file")
	print "## 「長いパス」を削除します"
	remove(pfx "/*.txt")
	tree(pfx)

	print "## 外部コマンドも呼び出せます"
	print "foo" > "Z:/Y/A/foo.txt"
	print "bar" > "Z:/Y/A/B/bar.txt"
	system("PowerShell tree /F Z:/Y")

	print "bar" >"Z:/TEMP/sync/foo.txt"
	print ""
	print ""
	print ""
	print "## パスの長さを表示します"
	tree("Z:/Y")
	print "# ファイルを表示します"
	tree("Z:/Y", "file")
	print "# ワイルドカードを指定"
	remove("Z:/Y/A/[ab]*.txt|c*.log")
	tree("Z:/Y/*.txt", "file")
	remove("Z:/Y")
	print "# リカーシブコールしません"
	print "foo" >"temp.tmp"
	remove("*.tmp", "-r")

	print ""
	print ""
	print ""

	print "## 同期コピー"
	copy("Z:/", "Z:/")
	print "bar" >"Z:/TEMP/sync/foo.txt"
	print "" >"X:/timeStamp"
	ls("X:/", ",")
	ls("Z:/", "k")
	copy("X:/", "Z:/", "sync")
	ls("Z:/", "k")
	print ""
	print ""
	print ""
	print ""
	print ""
	print ""

	print "## 移動(リネーム)"
	remove("W:/")
	remove("W:/", "root")
	move("Z:/lib.zip", "W:/lib.zip")
	ls("W:/", "k")
	move("Z:/", "W:/TMP")
	ls("Z:/", "k")
	ls("W:/", "k")
	print ""
	print ""
	print ""
	print ""
	print ""
	print ""
	print ""
	print ""
	print ""

	print "## ls"
	print "# リダイレクトし cat で表示します"
	ls("W:/", ">W:/ls.tmp")
	system("PowerShell cat W:/ls.tmp"
	ls("W:/", ",")
	ls("W:/", "0 -r")
#	copy("X:/", "W:/", "sync", ">W:/copy1.tmp 2>W:/copy2.tmp")
	ls("W:/", "k")
	print ""
	print ""
	print ""
	print ""
	print ""
	print ""
	print ""
	print ""
	print ""
}