12.9. 사용자 정의 GIO 메타데이터 특성 설정

다음 절차에서는 사용자 정의 메타데이터 특성을 설정하는 방법을 설명합니다.

이동 또는 이름 변경 후 특정 gio info 호출과 데이터 지속성 간의 차이점을 확인합니다. gio info 명령 출력을 확인합니다.

절차

  1. 빈 파일을 생성합니다.

    $ touch /tmp/myfile
  2. 이 파일의 메타데이터를 확인합니다.

    $ gio info -a 'metadata::*' /tmp/myfile
    uri: file:///tmp/myfile
    attributes:
  3. 문자열을 이 파일로 설정합니다.

    $ gio set -t string /tmp/myfile 'metadata::mynote' 'Please remember to delete this file!'
  4. 메타데이터를 확인합니다.

    $ gio info -a 'metadata::*' /tmp/myfile
    uri: file:///tmp/myfile
    attributes:
      metadata::mynote: Please remember to delete this file!
  5. 이 파일을 새 위치로 이동합니다.

    $ gio move /tmp/myfile /tmp/newfile
  6. 메타데이터를 확인합니다.

    $ gio info -a 'metadata::*' /tmp/newfile
    uri: file:///tmp/newfile
    attributes:
      metadata::mynote: Please remember to delete this file!

GIO API를 사용하여 파일을 이동할 때 메타데이터가 유지됩니다.

추가 리소스

  • gio 도움말 페이지.