五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

Sandbox

2023-04-04 01:00 作者:小粉絲8  | 我要投稿

import SwiftUI


/*

?project navigator / Targets / Signing & Capabilities / App Sandbox:

? User Selected File: Read/Write;

? Downloads Folder: Read/Write;

?*/


struct ContentView: View {

? @State private var fileDialogShown: Bool = false

? var body: some View {

? ? HStack {

? ? ? Button("Button1") { fileDialogShown = true }

? ? ? ? .fileImporter(isPresented: $fileDialogShown,

? ? ? ? ? ? ? ? allowedContentTypes: [.plainText])

? ? ? ? { result in

? ? ? ? ? guard let file = try? result.get() else { return }

? ? ? ? ? //Sandbox: User Selected File

? ? ? ? ? hello(file: file.path)

? ? ? ? }

? ? ? Button("Button2") { hello2() }

? ? }.frame(minWidth: 300, minHeight: 300)

? }

??

? func hello2(){

? ? //Sandbox: Downloads Folder, ~/Downloads

? ? let dir = FileManager.default.urls(for: .downloadsDirectory,

? ? ? ? ? ? ? ? ? ? ? ?in: .userDomainMask).first!

? ? let file = dir.appendingPathComponent("hello.txt")

? ? hello(file: file.path)

? }

??

? func hello(file: String){

? ? var fp = fopen(file, "a")

? ? if fp == nil {

? ? ? perror("fopen")

? ? ? return;

? ? }

? ? fputs("hello1\n", fp)

? ? fputs("hello2\n", fp)

? ? fclose(fp)


? ? fp = fopen(file, "r")

? ? var buffer = [CChar](repeating: 0, count: 128)

? ? while fgets(&buffer, Int32(buffer.count), fp) != nil {

? ? ? print(String(cString: buffer), terminator: "")

? ? }

? ? fclose(fp);

? }

}


Sandbox的評論 (共 條)

分享到微博請遵守國家法律
内乡县| 石首市| 南江县| 徐汇区| 自贡市| 杭州市| 舞阳县| 郓城县| 县级市| 阿拉尔市| 宜春市| 广水市| 攀枝花市| 聂拉木县| 山阳县| 金山区| 桓台县| 鄂托克旗| 白银市| 金华市| 宜君县| 永康市| 东阿县| 鄯善县| 隆林| 福安市| 鹤岗市| 玉林市| 博野县| 内黄县| 玛多县| 阿尔山市| 恩平市| 前郭尔| 通州市| 石首市| 惠州市| 安多县| 吉木乃县| 栾城县| 和林格尔县|