Add routine to get file length.
Fix bug in retrieving dirent for root. Reduce overhead in udf_get_link_count()
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: udf_file.c,v 1.3 2005/11/01 13:07:01 rocky Exp $
|
||||
$Id: udf_file.c,v 1.4 2005/11/02 03:42:50 rocky Exp $
|
||||
|
||||
Copyright (C) 2005 Rocky Bernstein <rocky@panix.com>
|
||||
|
||||
@@ -66,10 +66,18 @@ bool udf_get_fileid_descriptor(const udf_dirent_t *p_udf_dirent,
|
||||
uint16_t udf_get_link_count(const udf_dirent_t *p_udf_dirent)
|
||||
{
|
||||
if (p_udf_dirent) {
|
||||
udf_file_entry_t udf_fe;
|
||||
if (udf_get_file_entry(p_udf_dirent, &udf_fe)) {
|
||||
return uint16_from_le(udf_fe.link_count);
|
||||
}
|
||||
return uint16_from_le(p_udf_dirent->fe.link_count);
|
||||
}
|
||||
return 0; /* Error. Non-error case handled above. */
|
||||
}
|
||||
|
||||
/*!
|
||||
Return the number of hard links of the file. Return 0 if error.
|
||||
*/
|
||||
uint64_t udf_get_file_length(const udf_dirent_t *p_udf_dirent)
|
||||
{
|
||||
if (p_udf_dirent) {
|
||||
return uint64_from_le(p_udf_dirent->fe.info_len);
|
||||
}
|
||||
return 0; /* Error. Non-error case handled above. */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user