path names to CD across platforms

Dan Friedman dan at clearvisiontech.com
Fri Sep 5 16:52:00 EDT 2003


Byron,

Try this...  (This assumes that you pass a movie path without the drive
name/letter, and the CD (for the Mac) is named "myCDROM")...


 put getMoviePath("datafiles/movies/movie001.mov") into mPath


 function getMoviePath fileName
   if the platform = "MacOS" then
     if there is a file ("myCDROM/" & fileName) then
       return ("myCDROM/" & fileName)
     end if
   else
     if there is a file ("D:/" & fileName) then
       return ("D:/" & fileName)
     else if there is a file ("E:/" & fileName) then
       --just incase they mapped the CD drive to "E"
       return ("E:/" & fileName)
     end if 
   end if
 
   -- you might put some kind of warning or error
   -- routine here.  Probably don't want to continue
   -- if the movie was not found

   return false
 end getMoviePath 


There's probably a better way to do this, but it should work (I didn't test
it!).  Hope it helps,

Dan


> Message: 10
> Date: Fri, 5 Sep 2003 12:36:35 -0700
> Subject: path names to CD across platforms
> From: Byron Turner <byront at mac.com>
> To: use-revolution at lists.runrev.com
> Reply-To: use-revolution at lists.runrev.com
> 
> Forgive me if this gets posted twice, the first was held up and this is
> urgent.  How would I compensate for the differences in file path names
> when deploying to OS 9, OS X and Windows?  For example a movie resides
> on a CD . . how do we have one app that can be built for multiple
> platforms that can find the file regardless?
> 
> Thanks,
> 
> Byron




More information about the use-livecode mailing list