맥 한글 파일 이름 변환 FUSE 모듈

feanor의 이미지

맥오에스는 외롭습니다는 맥에서 한글 파일 이름 문제에 대한 글인데, 여기서 kz님이 말씀하시길

Quote:
macfuse를 통해 ntfs-3g를 쓰면 NTFS에 있는 한글 파일을 목록으로는 볼 수 있는데 열어볼 수는 없습니다. 이게 NFC를 NFD로 바꿔주지 않아서 그런 건데요. NFC-NFD를 실시간으로 변환해주면 어떠냐고 물어봤더니 안 된다고 답이 왔습니다. NTFS에서 NFC와 NFD를 동시에 허용하기 때문에 한 폴더 안에서 파일이름이 섞여 있거나 한 파일이름 안에서 섞여 있을 수 있어서 처리하기가 곤란하다는 거죠.

라고 하셨습니다.

ntfs-3g 프로젝트 입장에서 보면 이해가 되는 반응인데, 한국어 사용자의 경우 저런 문제가 생길 가능성은 별로 없으니까 NFC-NFD를 실시간으로 변환해주는 FUSE 모듈을 만들면 되지 않을까 싶었습니다.

그래서 간단히 만들어 봤습니다. 저는 맥 사용자가 아니라서 리눅스에서 테스트했고 파이썬 FUSE 모듈을 사용했습니다.

동작은 다음과 같습니다.

tinuviel@debian:~/devel/fuse$ python mount.py 
Usage: mount.py source target
tinuviel@debian:~/devel/fuse$ sudo python mount.py x y
tinuviel@debian:~/devel/fuse$ find x
x
x/ㄱㅏ
x/ㄱㅏ/ㄴㅏ
x/ㄱㅏㄴㅏ
tinuviel@debian:~/devel/fuse$ find y
y
y/가
y/가/나
y/가나
tinuviel@debian:~/devel/fuse$ cat x/ㄱㅏ/ㄴㅏ x/ㄱㅏㄴㅏ
가/나
가나
tinuviel@debian:~/devel/fuse$ cat y/가/나 y/가나
가/나
가나
tinuviel@debian:~/devel/fuse$ sudo umount y
File attachments: 
첨부파일 크기
Plain text icon mount.py_.txt1.69 KB

댓글

김도현의 이미지

감사합니다.

리눅스에서 nodecompose 옵션으로 맥파티션을 마운트한 후, 위 스크립트로 다시 마운트하니 한글 음절 영역으로 잘 표시되었습니다.

하지만 맥오에스 위에서 맥디렉토리 하나를 마운트하니 입출력에러가 나는 듯...

송효진의 이미지

파일시스템의 모든 기능을 구현한게 아니라서 오류가 나는 것 같네요.
http://sourceforge.net/apps/mediawiki/fuse/index.php?title=FUSE_Python_tutorial
여기를 참조해서 몇개만 만들면 사용할 수 있을 것 같습니다.

아이폰 마운트를 해 보니 한글이 문제가 되네요.ㅎㅎ
http://wiki.gentoo.org/wiki/Apple_iPod,_iPad,_iPhone

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.