Getting file extensions [linux fs]

Paulo da Silva p_s_d_a_s_i_l_v_a_ns at netcabo.pt
Sat Mar 30 20:27:39 EDT 2019


Às 22:18 de 28/03/19, Cameron Simpson escreveu:
> On 28Mar2019 01:12, Paulo da Silva <p_s_d_a_s_i_l_v_a_ns at netcabo.pt> wrote:
>> Às 23:09 de 27/03/19, Cameron Simpson escreveu:
...

> 
> Oh, just tangential to this.
> 
> If you were doing this ad hoc, yes calling the filefrag executable is
> very expensive. But if you are always doing a large batch of filenames
> invoking:
> 
>  filefrag lots of filenames here ...>
> and reading from its output can be very effective, because the expense
> of the executable is amortized over all the files - the per file cost is
> much reduced. And it saves you working out how to use the ioctls from
> Python :-)
That's not the case.
I need to do it on some files basis which I don't know in advance.
Using IOCTL, I don't need to parse or unpack the output. Only compare
the output arrays. Besides I need to store many of the outputs. Doing
that from filefrag text output would be unpractical. I needed, at least,
to compress the data. Although may be I might have to compress the ioctl
arrays ... Let's see how big in average is the storage needed.

I have to go with ioctl. I have to open the files anyway, so there is no
overhead for that when calling the ioctl.

Anyway, thank you for the suggestion.

Regards.
Paulo



More information about the Python-list mailing list