Skip navigation
Currently Being Moderated

Mac path statements

Jul 19, 2012 4:44 PM

I need a mac computer to locate a file on its CD drive.  I don't know how to write the mac path statement.  The operating system is OS Lion, by the way.  Basically, the file resides on a CD called July Research in a folder called JFYData.  Inside that folder is a file named 31854%75.rtf.  If I wanted the program on the Mac to access the CD in the drive, find the TstData folder, and see if it contains 31854%75.rtf, what is the Mac syntax for the path statement?

 

Thanks for whatever help you can give me with this.

 

Dewey

 
Replies
  • Currently Being Moderated
    Jul 19, 2012 7:04 PM   in reply to MECS

    If you know the drive is named July Research and that it is mounted (the disc is inserted in the drive), then you can simply use:

    tPath = "July Research:JFYData:31854%75.rtf"

     

    If you want to be sure, I'd suggest using Buddy API:

    sTargetDisk = EMPTY

    lDisks = baDiskList()

    repeat with aDisk in lDisks

      if baDiskInfo( aDisk, "type" ) = "CD-ROM" then

        -- this is probably the disk you're looking for, but just to be sure:

        if baDiskInfo( aDisk, "name" ) = "July Research" then

          sTargetDisk = aDisk

        end if

      end if

    end repeat

    -- the string variable sTargetDisk, if non-empty, contains the drive you are looking for

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 20, 2012 7:04 PM   in reply to MECS

    I don't know what the drive might be named, but the CD itself is named "July Research".  So, it sounds as if that negates the use of the simple tPath statement you gave me.  Is that right?

    No. What I was driving at is that when you insert a CD/DVD in a Mac the volume mounts and is assigned the name of the disc.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points