1. database.e file path
- Posted by frankied Oct 27, 2008
- 957 views
Hiya - I'm having trouble with database.e
include database.e ? db_open("csl/test.edb",DB_LOCK_EXCLUSIVE) ? db_compress()
outputs: 0 File not found - test.edb File not found - csl/test.t0 -2
This is a real problem for my CGI program which uses relative paths for the private db directory
2. Re: database.e file path
- Posted by ArthurCrump Oct 27, 2008
- 950 views
Hiya - I'm having trouble with database.e
include database.e ? db_open("csl/test.edb",DB_LOCK_EXCLUSIVE) ? db_compress()
outputs: 0 File not found - test.edb File not found - csl/test.t0 -2
This is a real problem for my CGI program which uses relative paths for the private db directory
Try csl//test.edb Within Euphoria strings /t is a tab
3. Re: database.e file path
- Posted by m_sabal Oct 27, 2008
- 958 views
Try csl//test.edb Within Euphoria strings /t is a tab
Actually, you have it backwards. Forward slash is just a slash. Backslash controls escape characters. \t is a tab, /t is just /t, and is just .
I think the real problem in this case is ACL permissions. The web server runs as a different user, and must have permission to access those files. Also, opening a database will generate a return code if the file doesn't exist yet. That return code needs to be checked, so the database can be created if necessary. Sometimes, that's also a good way to see what the CGI is trying to do when you insist the file it's looking for should already be there.
4. Re: database.e file path
- Posted by frankied Oct 27, 2008
- 943 views
Try csl//test.edb Within Euphoria strings /t is a tab
Actually, you have it backwards. Forward slash is just a slash. Backslash controls escape characters. \t is a tab, /t is just /t, and is just .
I think the real problem in this case is ACL permissions. The web server runs as a different user, and must have permission to access those files. Also, opening a database will generate a return code if the file doesn't exist yet. That return code needs to be checked, so the database can be created if necessary. Sometimes, that's also a good way to see what the CGI is trying to do when you insist the file it's looking for should already be there.
I asked Rob ages ago to update the database.e file so forward slashes could be used on both windows and *nix, which he did (thanks!). But now I've rearranged my file structure I get that error.
The problem here is not whether the file exists or not or permissions - this is not actual code for a website, it is the smallest code which gives the reproducable error. It already returns DB_OK (0) for the first open call. I think it has to do with the way database.e handles paths, and thus would tentatively say it's a bug, because it first tries to reference "test.edb" then it tries to reference "csl/test.t0" (the backup) when I presume it is trying to rename the database file to the backup before creating the new one. It then finally returns the error number. I've only had this problem with db_compress()