TOPIC: COMPUTER FILE
Copying only updated and new files
20th October 2008With Linux/UNIX, the command line remains ever useful and allows you to do all manner of things, including file copying that only adds new files to a destination. Here's a command that accomplishes this on Linux:
cp -urv [source] [destination]
The u
switch does the update while r
ensures recursion (by default, cp
only copies files from a source directory and not anything sitting in subfolders) and v
tells the command to tell the user what is happening.
Though buried and hardly promoted, Windows also has its command line and here's what accomplishes a similar result:
xcopy /d /u [source] [destination]
Anything's better than having to approve or reject every instance where source and destination files are the same or, even worse, to overwrite a file when it is not wanted.
Porting SAS files to other platforms and versions
1st October 2007SAS uses its transport file format to port files between operating and, where the need arises, different software versions. As with many things, there is more than one method to create these transport files: PROC CPORT/CIMPORT
and PROC COPY
with the XPORT
engine. The former method is for within version transfer of SAS files between different operating systems (UNIX to Windows, for instance) and the latter is for cross-version transfer (SAS9 to SAS 8, for example). SAS Institute has a page devoted to this subject which may share more details.
Uses for symbolic links
24th April 2007UNIX (and Linux) does a wonderful trick with its file and folder shortcuts; it effectively treats them as file and folder transporters that transfer associate a file or folder that exists in one folder hierarchy with another, and it is treated as if it exists in that hierarchy too. For example, the folder named images under /www/htdocs/blog
can have a link under /www/htdocs/
that makes it appear that its contents exist in both places without any file duplication. For instance, the pwd command cannot tell a folder from a folder shortcut. To achieve this, I use what are called symbolic links and the following command achieves the outcome in the example:
ln -s /www/htdocs/blog/images /www/htdocs/images
The first file path is the destination for the link, while the second one is that for the link itself. Once, I had a problem with Google Reader not showing up images in its feed displays, so symbolic links rode to the rescue as they did for resolving a similar conundrum that I was encountering when editing posts in my hillwalking blog.