Re: [sqlite] Extrange files

2006-03-01 Thread Nuno Lucas
On 3/2/06, Paul G <[EMAIL PROTECTED]> wrote:
> From: "Nuno Lucas" <[EMAIL PROTECTED]>
> > The only problem is that it can be a race condition between the
> > closing of the handle and the actual delete command (because you can't
> > delete an open file on win world).
>
> you lie!  if the file is opened with the delete sharemode set, it can be
> 'deleted' while open. in this case, it will be *really* deleted when the
> refcount drops to 0, iirc. besides, these hoops don't need to be jumped
> through if you're the process that issued the original CreateFile(), again
> iirc.

You're right, off course. When I wrote that I was only thinking on
Windows CE, which don't implement the FILE_SHARE_DELETE mode (at least
for CE <=4.2, not sure about the 5.0 version).

But note that the flag only exists on NT, not on Win9x (which can be
considered obsolete now, but was important enough to make me never use
it before).


Best regards,
~Nuno Lucas


Re: [sqlite] Extrange files

2006-03-01 Thread Paul G


- Original Message - 
From: "Nuno Lucas" <[EMAIL PROTECTED]>

To: <sqlite-users@sqlite.org>
Sent: Wednesday, March 01, 2006 10:36 PM
Subject: Re: [sqlite] Extrange files


The only problem is that it can be a race condition between the
closing of the handle and the actual delete command (because you can't
delete an open file on win world).


you lie!  if the file is opened with the delete sharemode set, it can be 
'deleted' while open. in this case, it will be *really* deleted when the 
refcount drops to 0, iirc. besides, these hoops don't need to be jumped 
through if you're the process that issued the original CreateFile(), again 
iirc.


-p 



Re: [sqlite] Extrange files

2006-03-01 Thread Nuno Lucas
On 3/1/06, Ralf Junker <[EMAIL PROTECTED]> wrote:
>
> >But I do not think that DOS has the ability
> >to automatically delete a file when it is closed, so the
> >files remain on disk after SQLite has finished with them.
>
> Just a thought:
>
> Wouldn't it possible to have SQLite thoughtfully delete all files it creates 
> when closing the database instead of relying on the operating system?
>
> I am not sure, but there might be plenty of OSes besides DOS that do not 
> automatically delete temporary files.

That's what the Windows CE port does, and I think I remember it's also
done on the Mac port (don't have the code in front of me and never
developed for a Mac).

The only problem is that it can be a race condition between the
closing of the handle and the actual delete command (because you can't
delete an open file on win world).

In the case of Windows CE, that risk is negligible. It would be even
less for DOS (last time I checked DOS wasn't multi-task, if we exclude
TSR's).

On (desktop) windows, this will not be so true, because of things like
anti-virus that open a file for scaning as soon as they are closed,
making the next delete to fail (but only sometimes and never on the
developper machine ;-).

> Ralf

Best regards,
~Nuno Lucas


Re: [sqlite] Extrange files

2006-03-01 Thread Thomas Chust

On Wed, 1 Mar 2006, RalfJunker wrote:

[...] Wouldn't it possible to have SQLite thoughtfully delete all files 
it creates when closing the database instead of relying on the operating 
system? [...]


Hello,

that would probably be possible, but not very efficient as you would have 
to keep a list of formerly used filenames around associated with the 
database handle.


Also SQLite3 does delete the temporary files, but I think (without having 
looked into the source now) it does so immediately after opening them as 
it is common good programming practice. I don't think DOS supports this 
approach, though.


cu,
Thomas


Re: [sqlite] Extrange files

2006-03-01 Thread Ralf Junker

>But I do not think that DOS has the ability
>to automatically delete a file when it is closed, so the
>files remain on disk after SQLite has finished with them. 

Just a thought:

Wouldn't it possible to have SQLite thoughtfully delete all files it creates 
when closing the database instead of relying on the operating system?

I am not sure, but there might be plenty of OSes besides DOS that do not 
automatically delete temporary files.

Ralf 



RE: [sqlite] Extrange files

2006-03-01 Thread Josep Lluís Vaquer
It works

You're great! Thanks a lot 

-Mensaje original-
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Enviado el: dimecres, 1 / març / 2006 16:03
Para: sqlite-users@sqlite.org; [EMAIL PROTECTED]
Asunto: Re: [sqlite] Extrange files

=?iso-8859-1?Q?Josep_Llu=EDs_Vaquer?= <[EMAIL PROTECTED]> wrote:
> I'm running DOS, Sqlite version 3.2.8. Attached example files
> 

The mailing list handler automatically strips attachments so
they did not get through.

The files you are seeing are probably temporary databases
that SQLite creates to support its internal processing.
Such temporary databases are automatically deleted on unix
and windows.  But I do not think that DOS has the ability
to automatically delete a file when it is closed, so the
files remain on disk after SQLite has finished with them.

To fix this, you might consider compiling SQLite so that
it stores temporary databases in memory rather than on disk.
Do so with this compile-time option:

-DTEMP_STORE=2

You can do this at runtime using a pragma:

PRAGMA temp_store=MEMORY;

--
D. Richard Hipp   <[EMAIL PROTECTED]>


--
Este mensaje ha sido analizado mediante ABServer Antivirus System
http://www.abserver.es/antivirus/panel.htm


--
Este mensaje ha sido analizado mediante ABServer Antivirus System
http://www.abserver.es/antivirus/panel.htm



Re: [sqlite] Extrange files

2006-03-01 Thread drh
=?iso-8859-1?Q?Josep_Llu=EDs_Vaquer?= <[EMAIL PROTECTED]> wrote:
> I'm running DOS, Sqlite version 3.2.8. Attached example files 
> 

The mailing list handler automatically strips attachments so
they did not get through.

The files you are seeing are probably temporary databases
that SQLite creates to support its internal processing.
Such temporary databases are automatically deleted on unix
and windows.  But I do not think that DOS has the ability
to automatically delete a file when it is closed, so the
files remain on disk after SQLite has finished with them.

To fix this, you might consider compiling SQLite so that
it stores temporary databases in memory rather than on disk.
Do so with this compile-time option:

-DTEMP_STORE=2

You can do this at runtime using a pragma:

PRAGMA temp_store=MEMORY;

--
D. Richard Hipp   <[EMAIL PROTECTED]>



RE: [sqlite] Extrange files

2006-03-01 Thread Josep Lluís Vaquer
I'm running DOS, Sqlite version 3.2.8. Attached example files 

-Mensaje original-
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Enviado el: dimecres, 1 / març / 2006 13:32
Para: sqlite-users@sqlite.org
Asunto: Re: [sqlite] Extrange files

=?iso-8859-1?Q?Josep_Llu=EDs_Vaquer?= <[EMAIL PROTECTED]> wrote:
> Hi, I'm new in Sqlite.
>  
> I'm trying to develop an aplication using Sqlite and it started to 
> work fine. I did a relatively simple Schema and builded a few views to 
> access easily. The problem started when I tried to access at one of 
> those views (only in one of those). Each select I do to this view 
> creates a couple of files in the main directory named SQLITE_ followed by
a number or a letter.
> When in this directory are a few of those apparently empty files 
> Sqlite stops working.
>  
> My answer is: why are those files generated? And what can I do to 
> solve this problem?
>  

What OS are you running?  What version of SQLite are you using?
Can you show me specific examples of the name of the files that are being
generated?
--
D. Richard Hipp   <[EMAIL PROTECTED]>


--
Este mensaje ha sido analizado mediante ABServer Antivirus System
http://www.abserver.es/antivirus/panel.htm


Re: [sqlite] Extrange files

2006-03-01 Thread drh
=?iso-8859-1?Q?Josep_Llu=EDs_Vaquer?= <[EMAIL PROTECTED]> wrote:
> Hi, I'm new in Sqlite.
>  
> I'm trying to develop an aplication using Sqlite and it started to work
> fine. I did a relatively simple Schema and builded a few views to access
> easily. The problem started when I tried to access at one of those views
> (only in one of those). Each select I do to this view creates a couple of
> files in the main directory named SQLITE_ followed by a number or a letter.
> When in this directory are a few of those apparently empty files Sqlite
> stops working. 
>  
> My answer is: why are those files generated? And what can I do to solve
> this problem? 
>  

What OS are you running?  What version of SQLite are you using?
Can you show me specific examples of the name of the files that
are being generated?
--
D. Richard Hipp   <[EMAIL PROTECTED]>



[sqlite] Extrange files

2006-03-01 Thread Josep Lluís Vaquer
Hi, I'm new in Sqlite.
 
I'm trying to develop an aplication using Sqlite and it started to work
fine. I did a relatively simple Schema and builded a few views to access
easily. The problem started when I tried to access at one of those views
(only in one of those). Each select I do to this view creates a couple of
files in the main directory named SQLITE_ followed by a number or a letter.
When in this directory are a few of those apparently empty files Sqlite
stops working. 
 
My answer is: why are those files generated? And what can I do to solve
this problem? 
 
I'll thank any help
 
 
 
JOSEP LLUÍS VAQUER 
R Department 
[EMAIL PROTECTED] 
Tel. (0034) 977 84 56 11 
FAX. (0034) 977 84 57 56 
Grupo Turomas