tail -f
가 멀쩡하게 작동하는 원리가 뭘까?
새 파일에 데이터가 추가되었음을 어떻게 알 수 있을까? 데이터가 추가되는 게 아니라 데이터가 완전히 바뀌어 버리면 어떻게 될까?
어떻게 newline-delimited라서 읽어보기 전까진 알 수 없는데 데이터를 읽어내는 것일까?
어떻게 새로 추가된 부분을 알 수 있을까? diff를 사용하나?
바이트 오프셋으로 비교하면 알 수 있는가?
j |
package main | |
import ( | |
"bytes" | |
"context" | |
"fmt" | |
"log" | |
"os" | |
"os/signal" | |
"strings" |
AD Andorra | |
AE United Arab Emirates | |
AF Afghanistan | |
AG Antigua and Barbuda | |
AI Anguilla | |
AL Albania | |
AM Armenia | |
AN Netherlands Antilles | |
AO Angola | |
AQ Antarctica |
tail -f
가 멀쩡하게 작동하는 원리가 뭘까?
새 파일에 데이터가 추가되었음을 어떻게 알 수 있을까? 데이터가 추가되는 게 아니라 데이터가 완전히 바뀌어 버리면 어떻게 될까?
어떻게 newline-delimited라서 읽어보기 전까진 알 수 없는데 데이터를 읽어내는 것일까?
어떻게 새로 추가된 부분을 알 수 있을까? diff를 사용하나?
바이트 오프셋으로 비교하면 알 수 있는가?
This guide assumes specific scenarios, such as when you need to dump an existing production environment database and run it locally for inspection or testing.
So we don't make any changes to the official MySQL image, build our own image, or publish a hefty image to our own private production-ready Docker registry running on EC2 instance, etc.
In this way, you can easily switch between multiple dump files with minimal effort; just copy the SQL files, and restart the container.
import ( | |
"fmt" | |
"golang.org/x/sys/unix" | |
) | |
func tCol() (int, error) { | |
var ws unix.Winsize | |
_, _, err := unix.Syscall( | |
unix.SYS_IOCTL, | |
uintptr(0), |
#include <stdio.h> | |
struct Person { | |
int age; | |
}; | |
struct Student { | |
int age; | |
int score; | |
}; |