Addressing your first question - what I meant is that the COMPILED mex file is using additional files to perform calculations for given inputs. Please trust me this is the best way it could be arranged (and it works nicely as long as these files stay in the designated subfolder in which case the hardcoded path is say 'addFiles\').
Thank you for the clarification. The reson why I was thinking about something like '.\' was because it MUST be flaxible. Finding the directory using PWD or WHICH will not help in this case because it will only be valid on a given, single machine and this mex file must work also when moved to a different computer. I thought if I put everything to one folder and tell mex file to use 'same directory as it is in, whatever it may be' it will solve the problem.
Any idea how to do it?
Thank you in advance, Mat
"Jan Simon" wrote in message <firstname.lastname@example.org>... > Dear Mateusz, > > > I am compiling a mexw32 file from an .f90 file. The mexw32 uses additional files. > > Does this mean that the Mex reads any data from a file? Or are the files needed for the compilation? > > > Problem I have is that I must put the additional files in the same directory as the mexw32 file, so the hardcoded path must point into the 'current' folder. > > The current folder is *not* the parent folder of the Mex file. You can use WHICH to determine the parent folder of a function. But there should be a better location to store data. > > Kind regards, Jan