>    /Users/gruber/Documents/foo
>
>into
>
>    Boot:Users:gruber:Documents:foo

There's always this:

   #!/usr/bin/perl -w
   use strict;

   my $unix = "/Users/gruber/Documents/foo";

   # find the name of the user's startup disk.
   my ($hd_name) = MacPerl::MakePath((MacPerl::Volumes)[0]);

   # change all slashes to ::.
   $unix =~ s#/#:#ig;

   # and prepend the HD name.
   my $mac = $hd_name . $unix;

Caveats: only run-able under Classic due to need for MacPerl::Volumes.
Also, if your Unix path has a ":" in it, the conversion for fail. OS X's
Finder turns all ":" in a Unix name to slashes:

  # in shell
  touch "filename:something"

  # in Finder
  filename/something

-- 
Morbus Iff ( i am your scary godmother )
http://www.disobey.com/ && http://www.gamegrene.com/
please me: http://www.amazon.com/exec/obidos/wishlist/25USVJDH68554
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus

Reply via email to