Regular expressions help request: source file of disk image volume
Regular expressions help request: source file of disk image volume
- Subject: Regular expressions help request: source file of disk image volume
- From: "Laine Lee" <email@hidden>
- Date: Mon, 14 Aug 2006 16:46:36 -0500
I recently posted replies to this thread:
http://lists.apple.com/archives/applescript-users/2006/Jul/msg00236.html
I discovered today that the solution I created got broken. I'm not sure at what point it broke, but I know I used it successfully in 10.4.6, I think I used it in 10.4.7, and I'm not sure I've used it since the last 10.4 security update. I know I have used it successfully on an Intel model.
Anyway, my solution is to use a shell script that gets a list of all disk image volume paths, then gets a list of disk image files whose volumes are mounted. Both of the lists are generated through "hdiutil info" shell script commands. The I just use a hash table to pair up the results and find the item I want. Included are the broken regular expressions used for the shell script followed by some that seem to be working now. What I'm hoping to get help with is a better regular expression string - one that isn't likely to break again. Thanks.
-- Broken list disk image volumes:
paragraphs of (do shell script "hdiutil info" & space & "|grep ^/dev/disk |grep -o /Volumes/.*' '*")
--Broken disk image source files
paragraphs of (do shell script "hdiutil info" & space & "|grep ^image'-'alias |grep -o /.*' '*")
--Working list disk image volumes:
paragraphs of (do shell script "hdiutil info" & space & "|grep ^/dev/disk |grep -o /Volumes/.*'*'*")
--Working list disk source files:
paragraphs of (do shell script "hdiutil info" & space & "|grep ^image'-'alias |grep -o /.*'*'*")
--
Laine Lee
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden