in reply to load_file and mysql

A thought occurred to me: does $file contain the full path to the file?, if it doesn't, then perhaps MySQL can't find the file you're looking for.
The reason it works in the CLI could be that you're running the CLI from the correct directory
Hope this helps
davis
Is this going out live?
No, Homer, very few cartoons are broadcast live - it's a terrible strain on the animator's wrist

Replies are listed 'Best First'.
Re: Re: load_file and mysql
by mce (Curate) on Feb 07, 2002 at 09:47 UTC
    Hi Davis,
    Thanks for your quick resonse
    If you look at the dir variable, you'll see a / in front of it. And the load_file always requires a fully qualified pathname.
    ---------------------------
    Dr. Mark Ceulemans
    Senior Consultant
    IT Masters, Belgium
      Hi there,
      The call to readdir will not return the full path - here's an example I've just tried:
      #!/usr/bin/perl -w use strict; my $dir = "/scratch"; opendir(DIR, $dir) or die "Unable to opendir $dir: $!\n"; foreach my $file (readdir DIR) { print "file is at: $file\n"; } closedir(DIR);
      That code will only print the file's paths relative to /scratch - in order to get the fully qualified path, I'd need to prepend the value of $dir.
      Note that this may still be barking up the wrong tree ;-)
      davis
      Is this going out live?
      No, Homer, very few cartoons are broadcast live - it's a terrible strain on the animator's wrist
Re: Re: load_file and mysql
by mce (Curate) on Feb 07, 2002 at 09:47 UTC
    Hi Davis,
    Thanks for your quick response
    If you look at the dir variable, you'll see a / in front of it. And the load_file always requires a fully qualified pathname.
    ---------------------------
    Dr. Mark Ceulemans
    Senior Consultant
    IT Masters, Belgium