chraebsli@programming.dev to Programmer Humor@programming.dev · 1 year agoTouch a file in Linuxprogramming.devimagemessage-square58fedilinkarrow-up1680arrow-down113
arrow-up1667arrow-down1imageTouch a file in Linuxprogramming.devchraebsli@programming.dev to Programmer Humor@programming.dev · 1 year agomessage-square58fedilink
minus-square4am@lemm.eelinkfedilinkarrow-up12arrow-down2·1 year ago“Do one thing and do it very well” is the UNIX philosophy after all; if you’re 99% likely to just create that missing file after you get a file not found error, why should touch waste your time?
minus-squareTrailblazing Braille Taser@lemmy.dbzer0.comlinkfedilinkarrow-up24·1 year agoBecause now touch does two things. Without touch, we could “just” use the shell to create files. : > foo.txt
minus-squaredeegeese@sopuli.xyzlinkfedilinkarrow-up16·1 year agoTouch does one thing from a “contract” perspective: Ensure the timestamp of is
minus-squaredan@upvote.aulinkfedilinkarrow-up11·1 year agoSystemd also does one thing from a contract perspective: run your system
minus-squaredukk@programming.devlinkfedilinkarrow-up1arrow-down2·1 year agoDoes it do it well, though?
minus-squarestebo@lemmy.dbzer0.comlinkfedilinkarrow-up12·1 year agowith this logic, any command that moves, copies or opens a file should just create a new file if it doesn’t exist and now you’re just creating new files without realising just because of a typo
minus-squareKusimulkku@lemm.eelinkfedilinkarrow-up7·1 year agoBut this directly goes against that philosophy, since now instead of changing timestamps it’s also creating files
“Do one thing and do it very well” is the UNIX philosophy after all; if you’re 99% likely to just create that missing file after you get a file not found error, why should
touch
waste your time?Because now touch does two things.
Without touch, we could “just” use the shell to create files.
Touch does one thing from a “contract” perspective:
Ensure the timestamp of is
Systemd also does one thing from a contract perspective: run your system
Oh no.
:(
Does it do it well, though?
with this logic, any command that moves, copies or opens a file should just create a new file if it doesn’t exist
and now you’re just creating new files without realising just because of a typo
But this directly goes against that philosophy, since now instead of changing timestamps it’s also creating files