728x90

최근에 개발을 하다보니 파일 경로에 "~1" 이 추가되면서 파일 경로명이 달라지는 현상을 경험하였다.

이런건 처음 겪어서 검색을 통해 LFN(Long File Name), SFN(Short File Name) 이라는 개념을 알게되었다.

https://community.spiceworks.com/topic/2317575-what-does-1-mean-when-seeing-it-in-a-folder-filepath

 

What does "~1" mean when seeing it in a folder/filepath?

It's the system way to integrate the long name of the files in systems before windows 95. In earlies days, the file names could only have 8 characters and the extensions only 3. To maintain the compatibility, the newer systems generate an 8.3 name for each

community.spiceworks.com

대충 위에 링크를 보면 이해는 될 것이다.

https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getlongpathnamew

 

GetLongPathNameW function (fileapi.h) - Win32 apps

Converts the specified path to its long form. (Unicode)

learn.microsoft.com

해당 현상을 경험하면서 "~1"이 붙은 LFN 경로를 원래대로 복구하고 싶을때 GetLongPathName() 를 이용하도록 하자.

728x90

+ Recent posts