Microplastics and Nanoplastics In Urban Air Originate Mainly From Tire Abrasion, Research Reveals
Read more of this story at Slashdot.
NASA Repairs Artemis 2 Rocket, Continues Eyeing April Moon Launch
Read more of this story at Slashdot.
Beloved village green given 'protected' status to stop it being built on
CodeSOD: Repeating Your Existence
Today's snippet from Rich D is short and sweet, and admittedly, not the most TFs of WTFs out there. But it made me chuckle, and sometimes that's all we need. This Java snippet shows us how to delete a file:
if (Files.exists(filePath)) { Files.deleteIfExists(filePath); }If the file exists, then if it exists, delete it.
This commit was clearly submitted by the Department of Redundancy Department. One might be tempted to hypothesize that there's some race condition or something that they're trying to route around, but if they are, this isn't the way to do it, per the docs: "Consequently this method may not be atomic with respect to other file system operations." But also, I fail to see how this would do that anyway.
The only thing we can say for certain about using deleteIfExists instead of delete is that deleteIfExists will never throw a NoSuchFileException.
[Advertisement] Plan Your .NET 9 Migration with ConfidenceYour journey to .NET 9 is more than just one decision.Avoid migration migraines with the advice in this free guide. Download Free Guide Now!
Good Housekeeping reveals the best Easter treats to buy - from hot cross buns to chocolate eggs - after 'biggest ever' taste test
Plans for 107 new affordable homes in Romford given green light
Kurds could begin ground operation in Iran within days 'after being secretly armed by US for MONTHS' - live updates
Jessie Buckley, Maggie Gyllenhaal and Marisa Tomei turn heads in luxe looks at The Bride premiere in NYC
Art dealer for Ant and Dec 'made secret and unauthorised profit from sale of a Banksy', High Court hears
Cartel leader 'El Mencho' buried in gold casket after death caused chaos in Mexico
LIV Golf stars left stranded in Dubai after Iranian counter attacks on UAE: 'It was terrifying'
Teenage girl intubated after attempting 'fire breathing' challenge she saw on social media
Iran strikes CIA base in Saudi Arabia in huge symbolic victory as spy agency arms Islamic militants to spark uprising
Gamers furious as indie studio Cloud Imperium quietly admits to data breach
Gamers are ready to unleash their mightiest virtual weapons and point them at independent games studio Cloud Imperium, after it sat on news of a data breach for weeks and then announced it without fanfare.…