MACSCRPT Archives

June 2011

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Nobumi Iyanaga <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Wed, 15 Jun 2011 21:26:24 +0900
Content-Type:
text/plain
Parts/Attachments:
text/plain (30 lines)
Hello,

I just posted my scripts that I used to set correct modified time to files/folders which got wrong modified time, because of some wrong (??) use of rsync.

In one of these scripts, I used the following lines to get the modified time and the size of files/folders.

for (@files) {
	if (-d $_) {
		$_ .= "/";
	}
	my $mod_date = `/usr/bin/GetFileInfo -m "$_"`;
	chomp $mod_date;
	my $sz = -s $_;
	$res .= $_ . "\t" . $mod_date . "\t" . $sz . "\n";
}

-- And in the result, I found many many zero byte files. I checked some of them, and found that some of them were indeed zero byte, but others were not (there were for example many alias files which returned zero byte with Perl's file test "-s"). So, it seems that Perl's file test "-s" is not very reliable when we have to deal with Mac file system.

It seems that "ls -l" gives the same zero byte for alias files, etc.

Does anyone know how it is possible to get the "real" byte size of files with some Unix tool?

Thank you very much in advance.

Best regard,

Nobumi Iyanaga
Tokyo,
Japan

ATOM RSS1 RSS2