Tuesday, February 24, 2009

Copy data from UNIX to Windows, keeping structure and timestamp


We are migrating our FTP server from UNIX, Tru64 to a Windows box, Server 2008.
We want to keep the structure and timestamp.

First tried tar.gz, thinking that Server 2008 is smart enough to be able to handle it, without me doing any trick.
No. It does not recognize .gz nor .tar. BTW, I did not give a try to the SUA, subsystem for UNIX-base application.
Since it is already a production server. I wanted to do it as simply as possible. Without installing anything.

I tried the GNU tar, which you do not have to really “install”, just have the executable.
Funnily, the timestamp is not preserved. The date is OK but time changes. We can easily guess that, in which case the time is not really OK either.
Some difference in ways to store datetime info, probably. I did not digg it further.

Then went for ZIP. I should have tried it first. Both platform claim that they support it natively. It was just that I do not use it often.

On UNIX, I zipped the folder structure, just normally without specifying any special option,

% zip -r (resulting zipfile) (folder to archive)
# This is just for me to remember the syntax. The man entry was not so easy to understand...

copied it over to Windows, and simply did the Extract All from the Right-Click menu.
This time, the timestamp of files are OK but not for folders. It appears that folders are created while it unarchives.
Looking into the zip file, without extracting it, shows that the dates are there. So it is just a problem with unarchiving, not with the way the zip file is created.

As far as my research goes, Windows 2008 does not seem to have a command line interface for unzip.
I found one at
http://www.info-zip.org/Info-ZIP.html. Seems a dicent project. Downloaded it and finally my folder timestamps are there!!


Tuesday, February 17, 2009

A small good-to-know with FireBug


Like me, I think you like it, the FireBug. It is really nice, helpful when especilly you work with CSS.
But have you ever been frustrated when you work on those for hyperlinks i.e. a:link, a:hover etc?
You want to know which of the classes takes the effect when it appears on the browser, but it tells you that only when you click the element.
But with the case with a hyperlink, when you do so, what takes the effect is that of “hover”, not that takes the effect when the page is loaded.

I was very frustrated, helpless, but found out that just by coincident, after you once selected the element, if you refresh the page, it tells you the css class that takes the effect at the page load time.