Re: Panther bug: 'missing value' for modification date??
Re: Panther bug: 'missing value' for modification date??
- Subject: Re: Panther bug: 'missing value' for modification date??
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 19 Feb 2004 08:26:27 -0800
On 2/19/04 6:00 AM, "Harald E Brandt" <email@hidden> wrote:
>
On Panther, as opposed to Jaguar, telling Finder to get the
>
modification date of a file on a mounted volume (belonging to another
>
computer) yields 'missing value' on first invocation, but gets the
>
date later on second invocation!? Why on earth is this so, and is
>
there any usable (fast) workaround?
>
Has this been reported? (I did not find any earlier report on this.)
>
>
Example: a volume is mounted fresh to my Mac OS 10.3.2 G4 computer
>
using 'Connect to Server'. The remote machine may also run 10.3, or
>
may be a 68k machine running some ancient 8.1. On my machine I issue:
>
>
tell application "Finder" to get modification date of file
>
"hd:Documents:a.p"
>
>
This yields 'missing value' on first invocation.
>
If I issue the command again, I get the date! I.e 2 invocations are
>
required!!.
>
(Subsequent requests also work of course, until the volume is ejected
>
and remounted whereupon the same error occurs.)
>
>
I tried the following workaround which does NOT work:
>
tell application "Finder"
>
try
>
get modification date of file "hd:Documents:a.p"
>
on error
>
get modification date of file "hd:Documents:a.p"
>
end try
>
end tell
'missing value' is not an AppleScript error, although the answer is wrong.
>
>
I also tried doing an 'update' before getting the date, but also that fails.
>
>
You may think that 'info for' would be a good workaround, but the
>
reason I want to use Finder is that it is so much faster (almost 5
>
times on a local volume, unless it's only a single request).
info for is always slow because it has to calculate the size of the file.
Well-known. (In OS 8/9, Akua Sweets had its own version specifically to
avoid the 'size' holdup.)
>
>
There's just got to be a solution, and a fast one, since I may
>
process thousands of files!
Why don't you just do it twice, without any error trapping:
tell app "Finder"
set modDate to modification date of file "hd:Documents:a.p"
set modDate to modification date of file "hd:Documents:a.p"
end
or, if you still find that slower than you'd like on your older non-Panther
machines:
tell app "Finder"
set modDate to modification date of file "hd:Documents:a.p"
if modDate is missing value then
set modDate to modification date of file "hd:Documents:a.p"
end if
end
I expect that something in Panther may be too _fast_ for the file to
"register" somewhere so that's why it doesn't get the mod date (or probably
other properties) of the file on first pass. But I don't know. You should
file it as a bug yourself at <
http://bugreport.apple.com>
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.