Skip to content

Instantly share code, notes, and snippets.

@Peranikov
Created December 20, 2017 11:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Peranikov/2bc0a94e422abd41294d14b3729335c0 to your computer and use it in GitHub Desktop.
Save Peranikov/2bc0a94e422abd41294d14b3729335c0 to your computer and use it in GitHub Desktop.
5–7-2 ファイルの操作
# ファイル名の変更
File.renaem 'src', 'dest'
# ファイルの移動
File.rename 'src', 'dir/dest'
# ファイルの削除
File.unlink 'fname'
# シンボリックリンク
File.symlink 'origin', 'sym'
# ハードリンク
File.link 'origin', 'sym'
# ファイルモードの指定
File.chmod 0600, 'fname'
# オーナー・グループの変更
File.chown 216, 216, 'fname'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment