2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
|
**
** dev_inode(FILENAME) returns a string. If FILENAME exists and is
** a regular file, then the return string is of the form:
**
** DEV/INODE
**
** Where DEV and INODE are the device number and inode number for
** the file. Or, on Windows, the return value is the canonical
** name of the file, because Windows does not have INODEs.
**
** If FILENAME does not exist, then the return is an empty string.
**
** The value of inode() can be used to eliminate files from a list
** that have duplicates because they have differing names due to links.
**
** Code that wants to use this SQL function needs to first register
|
|
|
>
|
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
|
**
** dev_inode(FILENAME) returns a string. If FILENAME exists and is
** a regular file, then the return string is of the form:
**
** DEV/INODE
**
** Where DEV and INODE are the device number and inode number for
** the file. On Windows, the volume serial number (DEV) and file
** identifier (INODE) are used to compute the value, see comments
** on the win32_file_id() function.
**
** If FILENAME does not exist, then the return is an empty string.
**
** The value of inode() can be used to eliminate files from a list
** that have duplicates because they have differing names due to links.
**
** Code that wants to use this SQL function needs to first register
|
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
|
zFilename = (const char*)sqlite3_value_text(argv[0]);
if( zFilename==0 || zFilename[0]==0 || file_access(zFilename,F_OK) ){
sqlite3_result_text(context, "", 0, SQLITE_STATIC);
return;
}
#if defined(_WIN32)
{
const char *zCanonical = file_canonical_name_dup(zFilename);
sqlite3_result_text(context, zCanonical, -1, fossil_free);
}
#else
{
struct stat buf;
int rc;
memset(&buf, 0, sizeof(buf));
rc = stat(zFilename, &buf);
|
|
>
|
>
>
>
|
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
|
zFilename = (const char*)sqlite3_value_text(argv[0]);
if( zFilename==0 || zFilename[0]==0 || file_access(zFilename,F_OK) ){
sqlite3_result_text(context, "", 0, SQLITE_STATIC);
return;
}
#if defined(_WIN32)
{
char *zFileId = win32_file_id(zFilename);
if( zFileId ){
sqlite3_result_text(context, zFileId, -1, fossil_free);
}else{
sqlite3_result_text(context, "", 0, SQLITE_STATIC);
}
}
#else
{
struct stat buf;
int rc;
memset(&buf, 0, sizeof(buf));
rc = stat(zFilename, &buf);
|