open("xy.txt", "w") do io
for line in eachline(io)
write(io, "EuRoXy")
print(io,
"""
Eu
Ro
Xy
""")
end
end
print(read("xy.txt", String))
show(readlines("xy.txt"))
open(f -> read(f, String), "xy.txt")
seek(f, 0) # return to beginning of file
show(read(f))
close(f)
rm(f) # recursive=true to rm dir, #force=true => a non-existing path is not treated as error
cd()
mkdir()
mkpath()
symlink()
chown()
chmod() # arg in octal e.g. 0o644
mv()
touch()
for (file, target) in zip(srcfiles, dest)
cp(file, target)
end
currdir = pwd()
xy = joinpath(currdir, "xy.txt")
splitdir(currdir)
splitpath(currdir)
splitext("xy.txt")
isdir(xy)
isfile(xy)
islink()
isfifo()
walkdir()
[path for path in readdir() if occursin("txt", path)]
filter(p -> !startswith(p, "."), readdir())
function hardlink(oldpath, newpath)
# calling: int link(char *oldpath, char *newpath)
ret_code = ccall(:link, Int32, (Cstring, Cstring), oldpath, newpath)
# handle system errors from libc:
systemerror("linking $oldpath -> $newpath", ret_code != 0)
end
fnam = "xy.txt"
run(Cmd(`ls -lh $fnam`, ignorestatus=true))
words = ["Eu", "Ro", "Xy"]
nums = 1:3
`$words$nums`
readlines(`ls`)
# regex
[fn for fn in filenames if occursin(r".git/objects/.*[abcde]{4}", fn)]