[윈도우] 0바이트 파일 생성

2023. 2. 25. 19:48프로그래밍

점프 투 스프링부트 실습중 h2 DB를 위한 db 파일을 만들라고 하는데 실습 설명 환경이 Mac 이라

 

윈도우에 대해서는 나와있지 않았다.

 

리눅스에서 0바이트 파일을 만들기 위해서 touch 명령어를 사용한다.

$ touch local.mv.db

 

윈도우에서는 

C:\Users\Administrator>fsutil file createnew local.mv.db
사용법: fsutil file createNew <파일 이름> <길이>
   예: fsutil file createNew C:\testfile.txt 1000

C:\Users\Administrator>fsutil file createnew local.mv.db 0
C:\Users\Administrator\local.mv.db 파일 작성

C:\Users\Administrator>

윈도우에서 0 바이트 파일 생성

윈도우에서 파일 생성하기 참고 - 윈도우 8 이후 부터 지원

https://learn.microsoft.com/ko-kr/windows-server/administration/windows-commands/fsutil-file

 

fsutil file

사용자 이름으로 파일을 찾고, 파일에 할당된 범위를 쿼리하거나, 파일의 짧은 이름을 설정하거나, 파일의 유효한 데이터 길이를 설정하거나, 파일에 대한 데이터를 0으로 설정하거나, 새 파일

learn.microsoft.com

리눅스에서 파일 생성하는 touch 명령 참고

https://ss64.com/bash/touch.html

 

touch Man Page - Linux - SS64.com

touch Change file timestamps, change the access and/or modification times of the specified files. Syntax touch [options]... File... Options -a --time=atime --time=access --time=use Change the access time only. -c --no-create Do not create files that do not

ss64.com