poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC] redoxfs.pk: Pickle for RedoxFS file system


From: Jose E. Marchesi
Subject: Re: [RFC] redoxfs.pk: Pickle for RedoxFS file system
Date: Sat, 19 Dec 2020 07:29:36 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> On Fri, Dec 18, 2020 at 05:58:09PM +0100, Jose E. Marchesi wrote:
>> 
>> >     uint<64> ctime;
>> >     uint<32> ctime_nsec;
>> >     uint<64> mtime;
>> >     uint<32> mtime_nsec;
>> >     uint<64> atime;
>> >     uint<32> atime_nsec;
>> 
>> What are the meaning of ctime, mtime and atime above?  I quickly looked
>> at the redoxfs source code but it wasn't obvious to me.
>
>
> (c)reation time, (m)odification time and last (a)ccess time.

Yes, but each timestamp seems to have two components: footime and
footime_nsec.  What are the meanings of the two components?

>> 
>> Maybe there is an opportunity there to factorize in a RedoxFS_Time
>> struct?
>> 
>> type RedoxFS_Time =
>>   struct
>>   {
>>      uint<64> whateverthesethingsare;
>>      uint<32> atime_nsec;
>>   };
>> 
>> along with a suitable pretty-printer...
>
> Sure!
> In fact it's `struct timespec` of C11 (according to the std `long` is
> at least 32 bit).
>
> ```c
> struct timespec
> {
>   time_t tv_sec;
>   long tv_nsec;
> };
> ```
>
> But Poke's `Timespec` is using `int<64>` for both fields.
> What's your suggestion?

Aaah, ok it is a timespec.

I would suggest to define a RedoxFS_Time.  Converting it to a poke
Timespec is as easy as:

  RedoxFS_Time {} as Timespec






reply via email to

[Prev in Thread] Current Thread [Next in Thread]