Re: Back and forth between Posix and HFS paths
Re: Back and forth between Posix and HFS paths
- Subject: Re: Back and forth between Posix and HFS paths
- From: Alex Zavatone <email@hidden>
- Date: Fri, 26 Mar 2010 12:42:47 -0500
On Mar 26, 2010, at 12:34 PM, Mark J. Reed wrote: That will fail for directories where the list of full paths of the items is too long (some a combination of a large number of items and/or a long root pathname), btw, though it should be fine on your 174-item folder if the folder itself isn't too deep in the filesystem. But you can make it more robust by removing the wildcard and manually assembling the full paths:
repeat with posixPath in paragraphs of (do shell script "ls -1t " & (quoted form of POSIX path of containingFolder)) set end of itemList to (POSIX path of containingFolder) & posixPath end repeat
It's also non-recursive; it only lists the top-level contents of the folder. If the folder has subfolders and you want to get the contents of them all the way down, with the whole thing sorted, that's more complicated. But your Finder version was using "items of" instead of "entire contents of", so this is the same result.
That's pretty much exactly what I'm looking for. "Get me the folder names of all the junk in the top level of this directory sorted so that the newest bits appear first and make sure you account for bizarre mac style characters, just in case".
The sucky part is that the folder being indexed is a volume on a 10.4 server running off a G4, so if we use a Finder call to get the sorted contents, it locks up the Finder while we wait for it to get the info off the server volume. It looks like Unix is the only way to go here.
And IF this works, I can put the folder action on the server so that it doesn't lock up the client machine's Finder.
Thanks man.
All this effort to get sorted directory contents. Geez. Thanks for the help everyone.
- Alex |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden