Title: Re: Witango-Talk: File path when writing to file in OSX
Sam
In Witango 5 we have added a <@MAKEPATH> tag that will normalize a path based on the OS the server is running on.  It converts // to / and changes / to \ on windows.  I used to use a custom tag in T2K to do this with a series of if and replace statements.

It is now part of the Witango 5 meta language.

You can get a file path by using the tag like this:

<@WEBROOT><br>
<@APPFILEPATH><br>
<@MAKEPATH "/Library/WebServer/Documents/" "<@APPFILEPATH>filename.ext" TYPE="filesystem"><br>
<@MAKEPATH "<@WEBROOT>" "<@APPFILEPATH>filename.ext" TYPE="filesystem">

Outputs the following on OS X:

/Library/WebServer/Documents/
/testfiles/
/Library/WebServer/Documents/testfiles/filename.ext
/Library/WebServer/Documents/testfiles/filename.ext

It is recommended to use this tag in file actions or anywhere you are accessing a file in the OS.  It makes the code portable and also ensures it is formatted correctly.

Phil

> I can't seem to get my file operations to work on my newly setup
> OSX/apache/witango5/filemaker6 server.  When writing to a file, I keep
> getting error -307, file actions require a full file path.
>
> My absolutefileprefix is currently set blank and I have tried every
> derivation of the path to make this work, with forward slash, back  
> slash,
> colons, etc.  Can someone give me a good example of a proper path for  
> an OSX
> machine?
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf

Reply via email to