| author | |
| committer | |
| log | 7248b4a4e437223a0c826dfbcb76b9835fce16d0 |
| tree | 4ead7ce724ce6928c1041c43307a869f393a5a5f |
| parent | c44e12dcd309ae4f18903d66e262c07f0a318296 |
100% of std.fs is now deprecated.5 files changed, 14 insertions(+), 17 deletions(-)
lib/compiler/aro/aro/Driver.zig+2-2| ... | ... | @@ -1219,12 +1219,12 @@ pub fn getDepFileName(d: *Driver, source: Source, buf: *[std.fs.max_name_bytes]u |
| 1219 | 1219 | fn getRandomFilename(d: *Driver, buf: *[std.fs.max_name_bytes]u8, extension: []const u8) ![]const u8 { |
| 1220 | 1220 | const io = d.comp.io; |
| 1221 | 1221 | const random_bytes_count = 12; |
| 1222 | const sub_path_len = comptime std.fs.base64_encoder.calcSize(random_bytes_count); | |
| 1222 | const sub_path_len = comptime std.base64.url_safe.Encoder.calcSize(random_bytes_count); | |
| 1223 | 1223 | |
| 1224 | 1224 | var random_bytes: [random_bytes_count]u8 = undefined; |
| 1225 | 1225 | io.random(&random_bytes); |
| 1226 | 1226 | var random_name: [sub_path_len]u8 = undefined; |
| 1227 | _ = std.fs.base64_encoder.encode(&random_name, &random_bytes); | |
| 1227 | _ = std.base64.url_safe.Encoder.encode(&random_name, &random_bytes); | |
| 1228 | 1228 | |
| 1229 | 1229 | const fmt_template = "/tmp/{s}{s}"; |
| 1230 | 1230 | const fmt_args = .{ |
lib/std/Io/net/test.zig+2-2| ... | ... | @@ -310,11 +310,11 @@ test "listen on a unix socket, send bytes, receive bytes" { |
| 310 | 310 | |
| 311 | 311 | fn generateFileName(io: Io, base_name: []const u8) ![]const u8 { |
| 312 | 312 | const random_bytes_count = 12; |
| 313 | const sub_path_len = comptime std.fs.base64_encoder.calcSize(random_bytes_count); | |
| 313 | const sub_path_len = comptime std.base64.url_safe.Encoder.calcSize(random_bytes_count); | |
| 314 | 314 | var random_bytes: [12]u8 = undefined; |
| 315 | 315 | io.random(&random_bytes); |
| 316 | 316 | var sub_path: [sub_path_len]u8 = undefined; |
| 317 | _ = std.fs.base64_encoder.encode(&sub_path, &random_bytes); | |
| 317 | _ = std.base64.url_safe.Encoder.encode(&sub_path, &random_bytes); | |
| 318 | 318 | return std.fmt.allocPrint(testing.allocator, "{s}-{s}", .{ sub_path[0..], base_name }); |
| 319 | 319 | } |
| 320 | 320 |
lib/std/fs.zig+6-9| ... | ... | @@ -4,15 +4,12 @@ const std = @import("std.zig"); |
| 4 | 4 | |
| 5 | 5 | /// Deprecated, use `std.Io.Dir.path`. |
| 6 | 6 | pub const path = @import("fs/path.zig"); |
| 7 | ||
| 8 | pub const base64_alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".*; | |
| 9 | ||
| 10 | /// Base64 encoder, replacing the standard `+/` with `-_` so that it can be used in a file name on any filesystem. | |
| 11 | pub const base64_encoder = std.base64.Base64Encoder.init(base64_alphabet, null); | |
| 12 | ||
| 13 | /// Base64 decoder, replacing the standard `+/` with `-_` so that it can be used in a file name on any filesystem. | |
| 14 | pub const base64_decoder = std.base64.Base64Decoder.init(base64_alphabet, null); | |
| 15 | ||
| 7 | /// Deprecated, use `std.base64.url_safe_alphabet_chars`. | |
| 8 | pub const base64_alphabet = std.base64.url_safe_alphabet_chars; | |
| 9 | /// Deprecated, use `std.base64.url_safe.Encoder`. | |
| 10 | pub const base64_encoder = std.base64.url_safe.Encoder; | |
| 11 | /// Deprecated, use `std.base64.url_safe.Decoder`. | |
| 12 | pub const base64_decoder = std.base64.url_safe.Decoder; | |
| 16 | 13 | /// Deprecated, use `std.Io.Dir.max_path_bytes`. |
| 17 | 14 | pub const max_path_bytes = std.Io.Dir.max_path_bytes; |
| 18 | 15 | /// Deprecated, use `std.Io.Dir.max_name_bytes`. |
lib/std/fs/test.zig+2-2| ... | ... | @@ -1777,8 +1777,8 @@ test "open file with exclusive nonblocking lock twice (absolute paths)" { |
| 1777 | 1777 | var random_bytes: [12]u8 = undefined; |
| 1778 | 1778 | io.random(&random_bytes); |
| 1779 | 1779 | |
| 1780 | var random_b64: [std.fs.base64_encoder.calcSize(random_bytes.len)]u8 = undefined; | |
| 1781 | _ = std.fs.base64_encoder.encode(&random_b64, &random_bytes); | |
| 1780 | var random_b64: [std.base64.url_safe.Encoder.calcSize(random_bytes.len)]u8 = undefined; | |
| 1781 | _ = std.base64.url_safe.Encoder.encode(&random_b64, &random_bytes); | |
| 1782 | 1782 | |
| 1783 | 1783 | const sub_path = random_b64 ++ "-zig-test-absolute-paths.txt"; |
| 1784 | 1784 |
lib/std/testing.zig+2-2| ... | ... | @@ -618,7 +618,7 @@ pub const TmpDir = struct { |
| 618 | 618 | sub_path: [sub_path_len]u8, |
| 619 | 619 | |
| 620 | 620 | const random_bytes_count = 12; |
| 621 | const sub_path_len = std.fs.base64_encoder.calcSize(random_bytes_count); | |
| 621 | const sub_path_len = std.base64.url_safe.Encoder.calcSize(random_bytes_count); | |
| 622 | 622 | |
| 623 | 623 | pub fn cleanup(self: *TmpDir) void { |
| 624 | 624 | self.dir.close(io); |
| ... | ... | @@ -633,7 +633,7 @@ pub fn tmpDir(opts: Io.Dir.OpenOptions) TmpDir { |
| 633 | 633 | var random_bytes: [TmpDir.random_bytes_count]u8 = undefined; |
| 634 | 634 | io.random(&random_bytes); |
| 635 | 635 | var sub_path: [TmpDir.sub_path_len]u8 = undefined; |
| 636 | _ = std.fs.base64_encoder.encode(&sub_path, &random_bytes); | |
| 636 | _ = std.base64.url_safe.Encoder.encode(&sub_path, &random_bytes); | |
| 637 | 637 | |
| 638 | 638 | const cwd = Io.Dir.cwd(); |
| 639 | 639 | var cache_dir = cwd.createDirPathOpen(io, ".zig-cache", .{}) catch |