Hi!
>>>>> "DAVE" == DAVE THOMAS <DAVET@stripped> writes:
DAVE> Hi,
DAVE> I am trying to create a file in the directory that the .frm, .MYI, and .MYD
DAVE> files are located for a particular table. I can create the file by
DAVE> hard-coding the path and specifying a filename but I need to be able to
DAVE> create the file in the folder of the database the table belongs to. How do I
DAVE> get the path that the database files are located? and the database name?
Why would you ever need to store a file in the database directory?
Normally this should not be done as this hampers MySQL ability to
create/destroy databases.
To do this, you must know the database name yourself.
You can get the base of the MySQL data directory with
'mysqladmin variables | grep datadir'
You can get the name of all databases with 'mysqlshow'
To know the directory, just concatenate the data directory with the
datababase name.
Regards,
Monty