objective c - Determine local drive from MDItemRef -


When I receive a list of returned MDItemRef items (in obj-c) I was thinking that Is there an easy way to determine if they come from an external USB drive connected to the OS install drive?

The basic premise is that I want to ignore anything from the local drive and only want to see files on external USB drives.

Thank you!

Una sugerencĂ­a Simple:

Hold the path of the item and see if it There is a prefix with "/ Volume /". If it is, then it is on an external device.

Example:

  MDItemRef myItem = ...; NSString * item path = (NSString *) MDItemCopyAttribute (myItem, kMDItemPath); If ([itempath heapfix: @ "/ version /"]) {NSLog (@ "external item found"); } Else {NSLog (@ "internal items found"); } [Itempath release];  

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -