Zig
Zig
S3 Create Bucket
See more Amazon S3 Examples
Demonstrates how to create a new bucket.Chilkat Zig Downloads
const std = @import("std");
const chilkat = @import("chilkat");
pub fn main(init: std.process.Init) !void {
const alloc = init.arena.allocator();
var success: bool = false;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
const http = try chilkat.Http.init();
defer http.deinit();
// Insert your access key here:
http.setAwsAccessKey("ABQXXABC83ABCDEFVQXX");
// Insert your secret key here:
http.setAwsSecretKey("XXXXYYYYabcdABCD12345678xxxxyyyyzzzz");
success = if (http.s3CreateBucket("chilkattestbucket")) true else |_| false;
if (!success) {
std.debug.print("{s}\n", .{try http.getLastErrorText(alloc)});
} else {
std.debug.print("Bucket created.\n", .{});
}
}