 2016. Andrew is a highly motivated person, who enjoys challenges. He has a solid foundation in mechanical services which has been complemented over the last 20 years with a high level of financial and contractual awareness. He has a keen interest in innovative installations methods which reduce risks whilst ensuring a high quality installations.The King of the road has landed and in search of it's next great adventure - and what a vehicle it is.
for the Grey Nomad, Off-road adventurer, family explorers or just those who want the performance AND economy and grunt of Toyota's twin turbo V8 4WD legend.
With all the hard work already done, don't wait too long though - Cruisers like this do not last long on our yard. Be quick or be sorry.Shop | In Stock Design Stamps New Fonts Sale Fun Sorting by : Catalog price: High to Low Catalog price: High to Low Catalog price: Low to High Name - A to Z Name - Z to AYou should be familiar with the mv(1) command by now, which moves a file from one place to another.
If you're writing shell scripts, or if you're using a library which lets you move files then you don't need to worry about how it works, but if you don't have a library available you might be surprised by the amount of effort required.
It's just a rename(2), right?
If you can guarantee that the destination is on the same filesystem and that you don't care if it replaces some other file, then yes.
mv(1) has the -n or --no-clobber option to prevent accidentally overwriting a file.
The naive way to do this would be to check whether the file exists before calling rename(2), but this is a TOCTTOU bug which can cause this to overwrite if another thread puts a file there.
To do this safely use renameat2(2) with the RENAME_NOREPLACE flag, which will make it fail if the destination already exists.
On a modern Linux distribution your files are usually spread across multiple file systems, so your persistent files are on a filesystem mounted from local storage, but your operating system puts temporary files on a different file system so they get removed when your computer shuts down.
Unfortunately, the rename(2) system call does not work if the destination is on a different file system.
Checking ahead of time whether a path is on a different file system is traditionally handled by calling stat(2), and checking whether the st_dev field differs, but this is another TOCTTOU bug waiting to happen and rename(2) sets errno(3) to EXDEV which lets you know it failed for being on another filesystem in the same system call you would have made anyway.
If you care about still being able to move the file when its destination is on a different file system then you need a fallback when this happens.
So we fall back to copying the file and removing the old one?
In principle, yes, though actually implementing this is surprisingly difficult.
Handling the fallback logic itself is not straight-forward, we'll get that out of the way first.
We can fallback to rename(2) if renameat2(2) is not implemented but only if we don't need to handle not clobbering the target.
When that happens we need to fall back to the copy, which can use O_EXCL with O_CREAT to only write to the file if it didn't already exist.
If unlinking the source file fails because the file doesn't exist, then that means that we were able to copy its contents while something else removed it.
Given the file was written to its destination and it no longer exists where it used to it can be argued that the operation as a whole was successful.
So we open both files, and loop reading data then writing it?
This will produce a file that when read, will produce the same stream of bytes as the original.
You could use stdio(3) to copy the contents, but that will have to be left as an exercise for the reader, since I don't like its record-based interface, I prefer to deal with file descriptors over FILE* handles, and the buffering makes error handling more… interesting.
So, broadly, the idea is to read into a buffer, then write from the buffer to the target file.
However, EINTR is a problem, many system calls can be interrupted before they do anything, and read(2) and write(2) may return less than you asked for.
Glibc has a handy TEMP_FAILURE_RETRY macro for handling EINTR, but to handle the short reads and writes, you need to always work in a loop.
So now we have a nice move_file function that will fall back to copying it if renaming does not work.
But code is of no use in isolation, we need a program for it to live in, and the simplest way to use it is a command-line program.
So we've got a complete fallback for rename(2) now?
doesn't occur on other systems.
Also, I had no idea you could make system calls without having a C wrapper for them, so thanks for that as well!
I don't like the buffering behaviour, it defers writes late enough that I lose context about what bit of the write failed, so when I go to flush and close I can't say how much was actually written.
There's also the fact that some signals can be configured to restart, but not others. Signals in general are a bit of a mess, so my way of dealing with it is to wrap everything in a retry and leave signal handling for shut down and use a better form of IPC for everything else.
Yep, it's a pain when the wrappers don't exist because you need to handle the error return calling convention yourself, since part of what the libc wrappers do is set errno. I tend to use negative error number returns in my own code rather than errno which makes it actually closer to what I prefer.I think I realized a new Mandela Effect, at least I've never seen it discussed anywhere.

I created this profile just to share this with you guys. I don't think I've seen it mentioned before anywheres on the internet as a Mandela Effect, but forgive me if it has. I've actually known about this but never put it together as a ME until late last night. So here it is:

Despite what I, and I think a lot of other people were taught growing up and still believe to be true, it is NOT illegal to drive with the dome light on in your car. Why did we all believe that it was? It's obviously distracting, but not illegal. 

On that same note, many including myself were under the impression it is illegal to drive without shoes. Again, not anywhere in the books, but yet so many of us were convinced it is illegal. Why?

So, what do you guys think? Please don't tear me a new one!

Greece has strongly denied it is heading for a sovereign default amid growing speculation that its debt has become unsustainable, almost a year after it was granted the biggest bailout in history.
Rebuffing reports that the country's burgeoning €340bn (£302bn) debt – predicted to reach 158% of GDP by 2012 – is at imminent risk of becoming unmanageable, the Greek finance minister Giorgos Papaconstantinou ruled out the prospect of a restructure, saying Athens was "on course" to putting its economy on track.
"We [the government] do not agree with the debt restructure idea. We can create new job positions and focus on investments instead. We will not be changing course," he said on Wednesday. "When you are in the depth of recession, you don't necessarily see the light. 
Eleven months after agreeing €110bn in rescue loans from the EU and IMF, George Papandreou's socialist government insists the financial lifeline will be enough to get through the country's worst economic crisis since the second world war. A restructuring, say officials, would not only be bad for banks and pension funds holding Greek debt, and make it impossible for the country to return to capital markets, but would be catastrophic for the eurozone where it could have a contagious effect. Not since the 1950s has a western state been forced to restructure its debt.
But Greece's worsening recession and galloping unemployment rates – the result, mostly, of unprecedented fiscal measures implemented in return for the bailout – and the spectre of yet more austerity policies has ensured that Greeks are now willing to throw national pride to the winds in favour of a default.
With the vast majority complaining of little gain for the financial pain they have had to endure – the average family has seen its disposable income drop by up to 40% as a result of rises in tax and pay and pension cuts – most now support the idea of a debt restructure.
MPs in Papandreou's restive Pasok party have grown increasingly vocal about the need for a restructure. "It's better to have a restructuring now, not necessarily haircuts but perhaps a repayment extension since the situation is going nowhere," said the veteran socialist MP Vasso Papandreou who heads parliament's economic affairs committee. "We keep taking measures as if we are in a vicious cycle."
Before yet more spending cuts his government is expected to announce on Friday, Papandreou is gathering his parliamentary group in an emergency session with an appeal to stay the course. The measures, which could include taxing fizzy drinks to help redress fiscal shortfalls, face a tumultuous vote in Athens