当前位置:网站首页>Go breakpoint continuation
Go breakpoint continuation
2022-06-24 06:41:00 【Give me a bottle of ice cream】
package main
import (
"fmt"
"os"
"strconv"
"io"
)
func main() {
// File directory
srcFile:="E:\\ Enterprise level Four layer load balancing lVS\\L100 - Enterprise level open source four layer load balancing solution -LVS( Full version ) - 199 element \\ The first 1 Chapter Course introduction \\1-1 LVS Learning guide video .mp4"
// replica catalog
destFile:="E:\\cpoy\\LVS Chapter one .mp4"
// Temporary directory
tempFile:=destFile+"temp.txt"
file1,_:=os.Open(srcFile)
file2,_:=os.OpenFile(destFile,os.O_CREATE|os.O_WRONLY,os.ModePerm)
file3,_:=os.OpenFile(tempFile,os.O_CREATE|os.O_RDWR,os.ModePerm)
defer file1.Close()
defer file2.Close()
//1. Read the data in the temporary file , according to seek
// Seek Set file pointer offset
file3.Seek(0,io.SeekStart)
bs:=make([]byte,100,100)
// read Read len(bs) byte
n1,err:=file3.Read(bs)
fmt.Printf(" Read byte size %v\n",n1)
countStr:=string(bs[:n1])
fmt.Printf(" Convert to string %v\n",countStr)
//count,_:=strconv.Atoi(countStr)
count,_:=strconv.ParseInt(countStr,10,64)
fmt.Printf(" Convert to INT64%v\n",count)
//2. Set read , Write offset
file1.Seek(count,0)
file2.Seek(count,0)
data:=make([]byte,1024,1024)
n2:=-1// Amount of data read
n3:=-1// Amount of data written
total :=int(count)// Total number of reads
for{
//3. Reading data
n2,err=file1.Read(data)
if err ==io.EOF{
fmt.Println(" File copy complete ..")
file3.Close()
os.Remove(tempFile)
break
}
// Write data to the target file
n3,_=file2.Write(data[:n2])
total += n3
// The total number of copies , Store in a temporary file
file3.Seek(0,io.SeekStart)
file3.WriteString(strconv.Itoa(total))
// Fake power failure
if total>8000000{
panic(" Pretend to be out of power ..., Pretend ...")
}
}
}
边栏推荐
- In the half year, there were 2.14 million paying users, a year-on-year increase of 62.5%, and New Oriental online launched its private domain
- About Stacked Generalization
- Innovating the security service mode, deeply convinced that the organization has been equipped with a "continuous online expert group"
- 解读AI机器人产业发展的顶层设计
- What is domain name resolution? How to resolve domain name resolution errors
- Go excel export tool encapsulation
- Cloudcompare & PCL point cloud clipping (based on clipping box)
- Small programs import Excel data in batches, and cloud development database exports CVS garbled code solution
- Word cannot copy and paste processing method
- Why the computer can't start
猜你喜欢

leetcode:1856. Maximum value of minimum product of subarray

Enter the software test pit!!! Software testing tools commonly used by software testers software recommendations

C语言学生管理系统——可检查用户输入合法性,双向带头循环链表

About Stacked Generalization

程序员使用个性壁纸
Fault analysis | using --force to batch import data leads to partial data loss

Programmers use personalized Wallpapers
![跳跃游戏II[贪心练习]](/img/e4/f59bb1f5137495ea357462100e2b38.png)
跳跃游戏II[贪心练习]

leetcode:剑指 Offer 26:判断t1中是否含有t2的全部拓扑结构

leetcode:85. Max rectangle
随机推荐
Vscode1.58 version update record Previous + related article summary
Domain name purchase method good domain name selection principle
Nine possibilities of high CPU utilization
leetcode:1856. 子数组最小乘积的最大值
记录--关于virtual studio2017添加报表控件的方法--Reportview控件
Code scanning | a sharp tool for controlling code quality
About Stacked Generalization
Implementation of code rate and frame rate statistics in easyplayer RTSP player
leetcode:84. The largest rectangle in the histogram
What are the audio formats? Can the audio format be converted
Kubernets traifik proxy WS WSS application
Analysis and treatment of easydss flash back caused by system time
Several methods for reinstalling the system:
If you want to learn programming well, don't recite the code!
Deploy DNS server using dnsmasq
Reasons for automatic allocation failure of crawler agent IP
Just now, we received a letter of thanks from Bohai University.
十年
SAP hum unbinds Hu from delivery order
Basic knowledge of wechat applet cloud development literacy chapter (I) document structure