Re: find problem
Re: find problem
- Subject: Re: find problem
- From: Stan Cleveland <email@hidden>
- Date: Mon, 04 Aug 2014 11:07:21 -0700
On Aug 4, 2014, at 10:27 AM, Luther Fuller wrote: I am using ...
quoted form of (POSIX path of searchFolder) do shell script "find " & the result & " -name " & filename & " -type d"
to get a list of aliases to folders with the name filename. It works very nicely when searchFolder is a folder, but I would like to search a disk.
That's where I encounter the problem. When I search a disk, I get multiple errors of the form:
/Volumes/Work_Files//.Spotlight-V100:Permission denied
all involving invisible folders.
Is there any way to work-around these errors? Is there any way to suppress these errors from the 'find' command ?
Hi Luther,
From the "find" man page: −d Cause find to perform a depth-first traversal, i.e., directories are visited in post-order and all
entries in a directory will be acted on before the directory itself. By default, find visits directories in pre-order, i.e., before their contents. Note, the default is not a breadth-first traversal. This option is equivalent to the -depth primary of IEEE Std 1003.1-2001 (“POSIX.1”). The −d
option can be useful when find is used with cpio(1)to process files that are contained in directories with unusual permissions. It ensures that you have write permission while you are placing
files in a directory, then sets the directory’s permissions as the last thing. I've not used the -d option, but it sounds promising. Something like this might be worth trying:do shell script "find -d " & the result & " -name " & filename & " -type d"
I usually add the -s option to traverse hierarchies in alphabetical order and -d to skip directories with a different device number: do shell script "find -dsx " & the result & " -name " & filename & " -type d"
Stan C.
|
_______________________________________________
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
References: | |
| >find problem (From: Luther Fuller <email@hidden>) |