On Mon, 27 Oct 2014 16:49:42 -0500
Nico Williams <n...@cryptonector.com> wrote:

> If it's not too much to ask for then SQLite3 ought to: a) check for
> duplicates by canonicalized path (but keep in mind that this can be
> difficult to do portably, or without obnoxious length limitations on
> Windows), 

The name is not the file.  Even Windows has hard links these days.  :-(

> then b) check for duplicates by st_dev/st_ino where available.

Not portable, but at least reliable.  :-)

The Googles reveal the BY_HANDLE_FILE_INFORMATION structure
returned by GetFileInformationByHandle
(http://msdn.microsoft.com/en-us/library/windows/desktop/aa364952
(v=vs.85).aspx) includes "a unique identifier that is associated with a
file".  Why that value couldn't be returned in st_ino by fstat(2) would
seem to to rest less on technical and more on commercial concerns.  The
"File ID" discussion (Remarks,
http://msdn.microsoft.com/en-us/library/windows/desktop/aa363788
(v=vs.85).aspx) is facinating in a morbid way.  

On reflection, I don't think a file uniqueness function is something
SQLite need provide in any form.  The application supplies the filename
of the database to attach.  It is capable of calling fstat or
GetFileInformationByHandle as appropriate if required, without help
from SQLite.  

--jkl


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to