다르게 해석하면 앞에서 부터 웹 레이아웃 구성요소들로 넣고, 가장 마지막에 페이지 하나에 대한 템플릿을 두면 된다.
func (*Template) ParseFiles ¶ func (t *Template) ParseFiles(filenames ...string) (*Template, error) ParseFiles parses the named files and associates the resulting templates with t. If an error occurs, parsing stops and the returned template is nil; otherwise it is t. There must be at least one file.
When parsing multiple files with the same name in different directories, the last one mentioned will be the one that results.
ParseFiles returns an error if t or any associated template has already been executed.
물론 inode도 다르고 전혀 다른 파일이지만 수정 하기 전까지는 공간을 차지 하지 않는데
수정하는 순간 대용량 파일이라면 갑자기 용량을 먹어 버리는데
전체 스토리지를 넘길 경우에는 어떻게 작동하려나?
해당 기능을 끄면 checksum도 끈다는 먼가 무시무시한 경고가 보인다.
Disabling CoW Warning: Disabling CoW in Btrfs also disables checksums. Btrfs will not be able to detect corrupted nodatacow files. When combined with RAID 1, power outages or other sources of corruption can cause the data to become out of sync. To disable copy-on-write for newly created files in a mounted subvolume, use the nodatacow mount option. This will only affect newly created files. Copy-on-write will still happen for existing files. The nodatacow option also disables compression. See btrfs(5) for details.
free와 available 이라는 미묘~하게 겹치는 비슷한 의미를 지닌 단어로 지칭되는 변수가 두개가 존재한다.
struct statvfs { unsigned long f_bsize; /* Filesystem block size */ unsigned long f_frsize; /* Fragment size */ fsblkcnt_t f_blocks; /* Size of fs in f_frsize units */ fsblkcnt_t f_bfree; /* Number of free blocks */ fsblkcnt_t f_bavail; /* Number of free blocks for unprivileged users */ fsfilcnt_t f_files; /* Number of inodes */ fsfilcnt_t f_ffree; /* Number of free inodes */ fsfilcnt_t f_favail; /* Number of free inodes for nprivileged users */ unsigned long f_fsid; /* Filesystem ID */ unsigned long f_flag; /* Mount flags */ unsigned long f_namemax; /* Maximum filename length */ };
# df;./arm.o Filesystem 1K-blocks Used Available Use% Mounted on /dev/mmcblk2p9 50500092132285246579560 3% /app/data 12625023 11644890 12294310 50500092 46579560 92.2 7.763416
값을 4k block -> 1k block 으로 변환해서 계산하면 아래와 같이 block / avail / free 값이 나온다.
df 의 used는 block - avail이 아니라 block - free 용량이라..
blocks
avail
free
12,625,023
11,644,890
12,294,310
50,500,092
46,579,560
49,177,240
3,920,532 (block - avail)
1,322,852 (block - free)
그럼 avail과 free는 무슨 차이일까? 저기.. unprivileged users의 의미가 도대체 멀까...
fsblkcnt_t f_blocks; /* Size of fs in f_frsize units */ fsblkcnt_t f_bfree; /* Number of free blocks */ fsblkcnt_t f_bavail; /* Number of free blocks forunprivileged users */
func GOMAXPROCS ¶ func GOMAXPROCS(n int) int GOMAXPROCS sets the maximum number of CPUs that can be executing simultaneously and returns the previous setting. It defaults to the value of runtime.NumCPU. If n < 1, it does not change the current setting. This call will go away when the scheduler improves.