orphanage

Check-in Differences
Login

Check-in Differences

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Difference From orphanage-0.2.0 To orphanage-0.2.1

2025-04-13
19:43
Add buf::random_size() for genrating a random buffer of random size. check-in: d01d6e0899 user: jan tags: trunk
2025-04-03
00:55
Release maintenance. check-in: 4d85544ea5 user: jan tags: orphanage-0.2.1, trunk
00:53
Change log fixups. check-in: 0ab734aab1 user: jan tags: trunk
00:38
Lossy cast. check-in: de2563a827 user: jan tags: trunk
2025-04-02
23:43
Add change log section. check-in: e41a571187 user: jan tags: orphanage-0.2.0, trunk
23:40
Release maintenance. check-in: 9678aea121 user: jan tags: trunk

Changes to Cargo.toml.
1
2
3

4
5
6
7
8
9
10
1
2

3
4
5
6
7
8
9
10


-
+







[package]
name = "orphanage"
version = "0.2.0"
version = "0.2.1"
edition = "2021"
license = "0BSD"
# https://crates.io/category_slugs
categories = [ "network-programming" ]
keywords = [ "sqlite", "fs", "path" ]
repository = "https://repos.qrnch.tech/pub/orphanage"
description = "Random collection of stuff that is still searching for a home."
Changes to src/fs.rs.
152
153
154
155
156
157
158

159










160
161
162
163
164
165
166
152
153
154
155
156
157
158
159

160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176







+
-
+
+
+
+
+
+
+
+
+
+







  let cstr_path = cstr.as_bytes_with_nul();

  let mut statfs = unsafe { std::mem::zeroed() };
  let result =
    unsafe { libc::statfs(cstr_path.as_ptr().cast::<i8>(), &mut statfs) };

  if result == 0 {
    #[cfg(target_os = "macos")]
    Ok(statfs.f_bavail as u64 * u64::from(statfs.f_bsize))
    let free = statfs.f_bavail as u64 * u64::from(statfs.f_bsize);

    #[cfg(target_os = "linux")]
    #[allow(clippy::cast_sign_loss)]
    let free = statfs.f_bavail * statfs.f_bsize as u64;

    #[cfg(not(any(target_os = "macos", target_os = "linux")))]
    let free = statfs.f_bavail as u64 * statfs.f_bsize;

    Ok(free)
  } else {
    Err(Error::IO("statfs() failed".into()))
  }
}

#[cfg(windows)]
fn get_free_space_win(path: &Path) -> Result<u64, Error> {
Changes to www/changelog.md.
1
2
3
4
5
6
7

8
9
10
11
12
13
14










15
16
17
18
19
20
21
1
2
3
4
5
6

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31






-
+







+
+
+
+
+
+
+
+
+
+







# Change Log

⚠️  indicates a breaking change.

## [Unreleased]

[Details](/vdiff?from=orphanage-0.2.0&to=trunk)
[Details](/vdiff?from=orphanage-0.2.1&to=trunk)

### Added

### Changed

### Removed

---

## [0.2.1] - 2025-04-03

[Details](/vdiff?from=orphanage-0.2.0&to=orphanage-0.2.1)

### Changed

- Fix a platform-specific cast.

---

## [0.2.0] - 2025-04-03

[Details](/vdiff?from=orphanage-0.1.4&to=orphanage-0.2.0)

### Added