Parse a Unix timestamp. In mtree, this is a float for some reason, even though the decimal place is always a `0`.
(input: &mut &str)
| 177 | /// |
| 178 | /// In mtree, this is a float for some reason, even though the decimal place is always a `0`. |
| 179 | fn timestamp(input: &mut &str) -> ModalResult<i64> { |
| 180 | let (timestamp, _) = cut_err(separated_pair(digit1.parse_to(), '.', digit1)) |
| 181 | .context(StrContext::Label("unix epoch")) |
| 182 | .context(StrContext::Expected(StrContextValue::Description( |
| 183 | "A unix epoch in float notation.", |
| 184 | ))) |
| 185 | .parse_next(input)?; |
| 186 | |
| 187 | Ok(timestamp) |
| 188 | } |
| 189 | |
| 190 | /// Parse a filesystem mode. |
| 191 | /// |