The "current directory" of the running NPAPI plugin won't be the extension's
directory. It's probably the Chrome directory. I think you can get the
directory the plugin is in through a windows API.

On Mon, Dec 14, 2009 at 3:05 PM, Nathan <nlapie...@gmail.com> wrote:

> I'm bundling a very large text file with my extension, which I want to
> extract data from. To do this, I have an NPAPI plugin, with the
> following code:
>
> FILE * pFile;
> char readStr[3];
> pFile = fopen("db" , "r");
> if (!pFile)
>  throw 1;
> fgets(readStr, 2, pFile);
> fclose(pFile);
>
> The exception is thrown, indicating the file can't be opened. The code
> works in a stand alone program, and I've also tried fstream to read
> the file.
>
> I assume there's a permission issue. The file is in the same directory
> as the DLL. How should I go about reading the file?
>
> Thanks
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Chromium-extensions" group.
> To post to this group, send email to chromium-extensi...@googlegroups.com.
> To unsubscribe from this group, send email to
> chromium-extensions+unsubscr...@googlegroups.com<chromium-extensions%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/chromium-extensions?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Chromium-extensions" group.
To post to this group, send email to chromium-extensi...@googlegroups.com.
To unsubscribe from this group, send email to 
chromium-extensions+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/chromium-extensions?hl=en.


Reply via email to