1. database.e file path

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

new topic     » topic index » view message » categorize

2. Re: database.e file path

frankied said...

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 

new topic     » goto parent     » topic index » view message » categorize

3. Re: database.e file path

ArthurCrump said...

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.

new topic     » goto parent     » topic index » view message » categorize

4. Re: database.e file path

m_sabal said...
ArthurCrump said...

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()

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu