helloSystem / Filer

A file manager that can also render the desktop
GNU General Public License v2.0
30 stars 9 forks source link

Also show btime (creation time) #94

Open probonopd opened 3 years ago

probonopd commented 3 years ago

Filer should also show btime (creation time) in the Get Info dialog.

probonopd commented 3 years ago

@Nearlytivk in https://github.com/helloSystem/hello/issues/142:

FreeBSD does not support to set btime (creation time)

According to https://unix.stackexchange.com/a/628286, full support for birth timestamps has three components:

According to https://unix.stackexchange.com/a/628286, UFS2 (the default in FreeBSD), ZFS (which helloSystem is using), FAT, and ISO-9660 are supporting them.

The stat command can read the "birth time of the inode". Is that the same as the btime (creation time)? What happens if a file is copied from e.g., FAT to zfs? (What is supposed to happen?)

Can you change the kernel for helloSystem so that it is possible to set btime like on macOS?

No, we are using the unchanged upstream FreeBSD kernel.

And as far as Filer is concerned, it needs to gracefully fall back if the kernel or the file system doesn't support btime.

leonard35-rgb commented 3 years ago

Maybe I can help, what is the current default behavior in macOS 11.4 (20F71).

Filer should also show btime (creation time) in the Get Info dialog.

Finder under macOS 11.4 shows the creation time under Get Info dialog by default. When the user switches to list view he can manually add creation time to the column. Simply with a right mouse click on the column and the user can add it immediately.

The name in english is under list view (column)

Screen Shot 2021-06-07 at 15 38 28

Under Get Info

Screen Shot 2021-06-07 at 15 50 06

leonard35-rgb commented 3 years ago

The stat command can read the "birth time of the inode". Is that the same as the btime (creation time)?

I tested the stat command on macOS 11.4, what the stat command shows as "birth time of inode" is btime (creation time).

You can test and compare it with Finder.

  1. First create an .rtf file with TextEdit
  2. 1 day later edit the .rtf file, now you have 2 different timestamps for btime and mtime (Modified).
  3. stat -f "mtime: %Sm%nbtime: %SB" /Users/macos/Desktop/hello.rtf
mtime: Jun 5 09:15:07 2021
btime: Jun 4 14:07:26 2021

Screen Shot 2021-06-07 at 16 00 17

  1. Open Finder and check the hello.rtf file and it shows the same time as stat command. Finder (list view column)
    • Date Modified Jun 5, 2021 at 09:15:07
    • Date Created Jun 4, 2021 at 14:07:26

Screen Shot 2021-06-07 at 16 06 40

Note: By default Finder does not show seconds for files and folders, this can be changed under System Preferences > Language & Region > Advanced... > Times > Short:

Screen Shot 2021-06-07 at 15 55 34

Screen Shot 2021-06-07 at 15 56 00

Note 2: Unfortunately Finder does not display atime (Accessed) and ctime (Changed) because stat command supports 4 timestamps in total (atime, mtime, ctime and btime). stat -f "atime: %Sa%nmtime: %Sm%nctime: %Sc%nbtime: %SB"

leonard35-rgb commented 3 years ago

What happens if a file is copied from e.g., FAT to zfs? (What is supposed to happen?)

Under macOS 11.4, I use APFS as the file system for the internal hard drive.

And my external USB hard drive use APFS, HFS+ and Microsoft file system like exFAT and FAT32 because macOS support write and read for these file systems.

When I copy folders and files with the Finder, no matter which way, mtime and btime are always kept from source to destination.

Screen Shot 2021-06-07 at 16 10 25

probonopd commented 3 years ago

This is the behavior we want.

leonard35-rgb commented 3 years ago

This is the behavior we want.

Exactly. I have added some screenshots of how it currently looks with macOS 11.4.

If is still important here is Disk Utility under macOS 11.4 and it shows me this way to delete my external 32GB USB flash drive.

Note: MS-DOS (FAT) this is FAT32.

Screen Shot 2021-06-07 at 17 32 16

probonopd commented 3 years ago

Thanks @leonard35-rgb.

Has anyone tested yet what happens to the "birth time of the inode" on FreeBSD if a file is copied from e.g., FAT to zfs and vice versa?

leonard35-rgb commented 3 years ago

Thanks @leonard35-rgb.

:) Has anyone tested yet what happens to the "birth time of the inode" on FreeBSD if a file is copied from e.g., FAT to zfs and vice versa?

I tried to start helloSystem for the first time on my Mac device. Here is the history.

I downloaded this latest helloSystem version. https://github.com/helloSystem/ISO/releases/tag/experimental-13.0

  1. Then on my second Mac device, it is an iMac 2012 with Intel processor, loaded and opened balenaEtcher .dmg file. https://github.com/balena-io/etcher/releases/tag/v1.5.120

  2. Flashed hello-0.5.0_0E218-FreeBSD-13.0-amd64.iso file to my external USB flash drive (FAT32) with balenaEtcher.

  3. Restarted the iMac and selected the external USB flash drive.

  4. I saw a black screen and a lot of text entries, then the FreeBSD logo appeared for a moment. Note: The FreeBSD logo does not look harmonious, I do not like it. Looks like a devil. Note 2: The boot process of macOS or generally when I start a macOS or install a new system update it always has a adapted graphical user interface for this area, do not see a black screen with many text entries.

  5. Then the FreeBSD logo was gone and there was only a black screen.

  6. I waited and after a few seconds I heard a loud sound (it was disturbing) and could not turn it off. The screen itself was always black, I see no GUI. It seems that this is the startup sound of helloSystem. It was so loud and I immediately turned off the iMac. Tried it several times later, always the same result. I only see a black screen at the end and there is always a loud sound. I can't turn off the sound, tried several times on Magic Keyboard (Bluetooth) to press the quiet key (F11) or the mute key (F10), nothing happens.

probonopd commented 3 years ago

Duplicate of https://github.com/helloSystem/Filer/issues/29. Closing in favor of https://github.com/helloSystem/Filer/issues/29.

Upstream seems to have an implementation that needs to be backported.