logo
down
shadow

What is the difference between find command options- -atime & -mtime?


What is the difference between find command options- -atime & -mtime?

By : user2956379
Date : November 22 2020, 10:56 AM
To fix the issue you can do I cannot understand the difference between -atime & -mtime options of 'find' command. The man page gives the same definition for both of them.
code :
atime is the file access time.  
mtime is the file modify time.


Share : facebook icon twitter icon
C Linux stat() getting atime/mtime with nsec precision

C Linux stat() getting atime/mtime with nsec precision


By : james
Date : March 29 2020, 07:55 AM
wish of those help st_mtime should be a time_t. According to POSIX , the type of tv_nsec is just long. The fields like st_mtim.tv_nsec will return the number of nanoseconds. For the long, you need l; for time_t, it is not clearly defined, AFAIK.
How can I get a file's ctime, atime, mtime and change them

How can I get a file's ctime, atime, mtime and change them


By : Davey
Date : March 29 2020, 07:55 AM
I wish this helpful for you How can I get file's ctime, mtime, atime use Go and change them? ,
Linux
code :
package main

import (
    "fmt"
    "os"
    "syscall"
    "time"
)

func statTimes(name string) (atime, mtime, ctime time.Time, err error) {
    fi, err := os.Stat(name)
    if err != nil {
        return
    }
    mtime = fi.ModTime()
    stat := fi.Sys().(*syscall.Stat_t)
    atime = time.Unix(int64(stat.Atim.Sec), int64(stat.Atim.Nsec))
    ctime = time.Unix(int64(stat.Ctim.Sec), int64(stat.Ctim.Nsec))
    return
}

func main() {
    name := "stat.file"
    atime, mtime, ctime, err := statTimes(name)
    if err != nil {
        fmt.Println(err)
        return
    }
    fmt.Println(atime, mtime)
    fmt.Println(ctime)
    err = os.Chtimes(name, atime, mtime)
    if err != nil {
        fmt.Println(err)
        return
    }
    atime, mtime, ctime, err = statTimes(name)
    if err != nil {
        fmt.Println(err)
        return
    }
    fmt.Println(atime, mtime)
    fmt.Println(ctime)
}
2014-01-02 02:21:26.262111165 -0500 EST 2014-01-02 02:18:13.253154086 -0500 EST
2014-01-02 02:21:25.666108207 -0500 EST
2014-01-02 02:21:26.262111165 -0500 EST 2014-01-02 02:18:13.253154086 -0500 EST
2014-01-02 02:21:43.814198198 -0500 EST
ctime, atime, and mtime - How to interpret them?

ctime, atime, and mtime - How to interpret them?


By : user2908632
Date : March 29 2020, 07:55 AM
I hope this helps . You can get something useful from this by using the stat module to interpret the stat() results and converting from the epoch to a datetime:
code :
import os
import datetime

print datetime.datetime.fromtimestamp(os.stat(".").st_atime)
datetime.datetime(2014, 12, 17, 7, 19, 14, 947384)
atime and mtime? Inspired by touch(1)

atime and mtime? Inspired by touch(1)


By : Praveena Namuduri
Date : March 29 2020, 07:55 AM
I hope this helps . There are 3 kind of "timestamps":
Access - the last time the file was read Modify - the last time the file was modified (content has been modified) Change - the last time meta data of the file was changed (e.g. permissions)
code :
stat filename
softlinks atime and mtime modification

softlinks atime and mtime modification


By : Ethan M. Namkung
Date : March 29 2020, 07:55 AM
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org