Relative Paths

jon2211's icon

So I have this:

C: Drive
|
|-------Max APPLICATION FOLDER
| -EXE dlls etc
|
|-------MIDI FIle Folder
-MIDI FIle

normally I would think (read ../MIDI File Folder/Midi File)
would be the relative path from the EXE to the MIDI file. Doesn't seem to work. What's up with that?

Thanks

Windows XP SP3
MAx/MSP/Jitter 5.0.5

Emmanuel Jourdan's icon

On 30 oct. 08, at 16:12, Jon Grant wrote:

> So I have this:
>
> C: Drive
> |
> |-------Max APPLICATION FOLDER
> | -EXE dlls etc
> |
> |-------MIDI FIle Folder
> -MIDI FIle
>
> normally I would think (read ../MIDI File Folder/Midi File)
> would be the relative path from the EXE to the MIDI file. Doesn't
> seem to work. What's up with that?

You can construct absolute path. For that you will need to get the
location of your application by using the max sendapppath message, and
generate the proper file path using sprintf or combine.

HTH,
ej

Max Patch
Copy patch and select New From Clipboard in Max.

Rob Sussman's icon

Also, I'd be curious if it worked if you first put a single dot before the two dots like this:

"./../Midi File Folder/Midi File"

Rob

jon2211's icon

./../

totally worked to go to a parent folder

YEAH!

Brennon Bortz's icon

Hmm...doesn't work for me. Relative paths (with or without a "./") work for me on OS X, but not on Windows (Windows Server, XP, or Vista). This severely affects the portability of patches, especially when sending to Microshaft-based machines. Any ideas?

Thanks!

Rob Sussman's icon

Perhaps you can post a specific example of what didn't work?

Thanks,
Rob