Here's the method I wrote, this will obviously only work on os x.

                method "urlPath2Posix"($path)
                        if ($path[[1]] = "/") // is it in url style?
                                $sysfolder := join paths(execute in 4d("SYSTEM 
FOLDER";*))
                                $bootvol := 
substring($sysfolder;1;position("/";$sysfolder;2))

                                if (substring($path;1;position("/";$path;2)) = 
$bootvol) //this is
the boot volume
                                        $path := 
substring($path;position("/";$path;2);length($path))
                                else
                                        $path := "/Volumes" + $path             
        // this is a non-boot volume
                                end if

                        end if
                                                
                        return($path)

                end method


On Tue, Feb 17, 2009 at 5:04 PM, Michael Check <[email protected]> wrote:
> I saw that Aparajita was working on re-coding the url and native paths
> conversion for A4D v11.
>
> Well, it brings up an issue we're having right now and I was wondering
> if there are any methods written for handling that conversion now.
>
> We're sending some path and file information to php for processing and
> it is barfing when we send the url-style paths because they start with
> the Volume name.
>
> We're running on os x.  So when we execute
>
> join paths (root path; "lib"; "script.php")
>
> we get: /HARDDRIVE/app1/lib/script.php
>
> to send into php cli using Launch External Process, we need the
> absolute path in posix style: /app1/lib/script.php
>
> So I wrote a routine to strip the volume name off.  Trouble is that if
> the file is on a Volume, I need to _append_ "/Volumes"
>
> So again, I can figure out if the Volume is the root volume, and
> adjust as necessary, but I was wondering if this is something for
> which there are already commands or methods to handle it.  Am I
> missing the proper way this is handled?
>
> Or perhaps this is why Aparajita is rewriting it for v11... :)
>
> --
> Thanks,
>
> Michael Check
> _______________________________________________
> Active4D-dev mailing list
> [email protected]
> http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
> Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/
>



-- 
Thanks,

Michael Check
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to