I’m sure I’ve seen this somewhere on this site before but no combination of search keys I’ve tried is turning it up so…
I have a script to watch a hot folder via an idle handler that opens files in Photoshop CS2.
The problem is that occasionally when I get larger files, the bottom of the file is corrupted. (But not always - drop the same file again and it’s fine.) I suppose this is because it’s loading before the entire file has been copied to the hot folder.
My obvious question - how can I determine that the entire file is there before opening it? This will be a folder on a Helios-mounted Unix server volume, so I’m not sure what would be effective here, such as Objective-C methods or Unix “fuser” calls or ??? Or do Photoshop Actions offer anything that AppleScript doesn’t that would help here? What does the AppleScript Intelligensia do to handle this?
Thanks a lot Mark. I’ll look at fstat, but now that you mention it the file size check is probably the most reliable - I’d done that in the distant past somewhere else and forgot all about it. Certainly one of those will work
Much obliged!
Dan
Edit: Whoa, I posted this and then saw your second post. "bzy "? I never knew that…if that works then it’s definitely the way I’ll go, if only because of the coolness factor. Some things trump efficiency, and cool is one of them.
I think this’ll work nicely - I’d be surprised if we encountered anything much bigger than 100MB but theoretically any size is susceptible, I guess. Nice…