LoginSignup
1
0

More than 5 years have passed since last update.

[memo] ファイルのサイズ操作 #Ruby

Last updated at Posted at 2012-03-16
# サイズを指定してファイル作成
ruby -e "1.upto(9){ |n| @f=%{ #{n}k.txt }; %x{ del #@f }; %x{ fsutil file createnew #@f #{n*1024} } }"

# ファイルのサイズを0にする
ruby -e "Dir[ %{./*.txt} ].map{ |e| File.truncate(e, 0) }"

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0