D28388: kio_file: honour KIO::StatResolveSymlink for UDS_DEVICE_ID and UDS_INODE

Ahmad Samir noreply at phabricator.kde.org
Tue Mar 31 10:29:20 BST 2020


ahmadsamir added a comment.


  In D28388#637419 <https://phabricator.kde.org/D28388#637419>, @dfaure wrote:
  
  > In D28388#637417 <https://phabricator.kde.org/D28388#637417>, @ahmadsamir wrote:
  >
  > > (Now the other issue, "DEVICE" (from the kproperties patch) is always "8", whether I use ~/.bashrc, /usr/bin/file, or some file on a usb stick. But that's not really related to this diff).
  >
  >
  > That's really odd. And what does `stat` say?
  >  E.g. I get 
  >  Device: fe01h/65025d
  >  on one partition, and
  >  Device: fe04h/65028d
  >  on another. Those decimal values match the debug output from that kpropertiesdialog patch.
  
  
  Sorry for the delay; it turns out statx is available on my system, so 'stat_dev(buff)' called:
  
    inline static uint16_t stat_mode(struct statx &buf) { return buf.stx_dev_major; }
  
  which is always 8 on my system.
  
  I propose changing it to combine stx_dev_major and stx_dev_minor:
  
    inline static uint32_t stat_dev(struct statx &buf)
    {
        return (buf.stx_dev_major * 100) + buf.stx_dev_minor;
    }
  
  so for example:
  
    $ stat /usr/bin/file | grep Device
    Device: 804h/2052d      Inode: 9168        Links: 1
    $ stat ~/.bashrc | grep Device
    Device: 803h/2051d      Inode: 97          Links: 1
  
  "DEVICE" (from kpropertiesdialog) would be, respectively:
  
    804
    803
  
  I am not an expert on these low-level stat calls, but that seems to make sense to me anyway :)

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D28388

To: dfaure, trmdi, ahmadsamir, meven
Cc: kde-frameworks-devel, LeGast00n, cblack, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200331/de71ff16/attachment.html>


More information about the Kde-frameworks-devel mailing list