Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Windows support #674

Merged
merged 150 commits into from
Oct 8, 2015
Merged
Show file tree
Hide file tree
Changes from 146 commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
be691b0
use coolio 1.2.0
okahashi117 Jul 12, 2013
2db5326
coolio 1.2.0 from 1.1.0
okahashi117 Jul 12, 2013
a4946e3
Update fluentd.gemspec
MasayukiKiyota Jul 17, 2013
81d6633
for Windows platform
Jul 17, 2013
4cd9afb
for Windows platform
Jul 17, 2013
79987d4
Update README.rdoc
okahashi117 Jul 29, 2013
b7277d2
Use 'unless $platformwin' instead of 'if $platformwin == false'
okahashi117 Jul 29, 2013
86d0a76
$usespawn is changed to a member of Supervisor.
okahashi117 Jul 30, 2013
4bef7b2
copyedited the README
Aug 1, 2013
286c192
win32api constats definition for file operation.
okahashi117 Oct 29, 2013
3a82bbd
Goodbye incomprehensible code indent from buffer.rb and output.rb
repeatedly Jul 26, 2013
8b931b1
Merge commit '4675251f43754669c51d3a0a5d6d5b4fa5d38c2e' into windows
okahashi117 Oct 29, 2013
dbae161
Merge commit '294427fa7ff59b75d2e0b57d7e62104d704419ff' into windows
okahashi117 Oct 30, 2013
0997bbd
using named constant values, instead of number literal.
okahashi117 Oct 31, 2013
ca3e683
fix : incorrect io.read on Windows
okahashi117 Nov 1, 2013
31a02df
update readme.
okahashi117 Nov 1, 2013
9fd163c
Copy an original readme of fluentd int readme.rdoc.
okahashi117 Nov 11, 2013
20d3f13
Merge commit '216d06be2d7cb3332f7fadca6767c200c5febce7' into windows
okahashi117 Nov 11, 2013
b1ad266
update a comment.
okahashi117 Nov 11, 2013
50aca45
add some basic codes for win32api.
okahashi117 Nov 11, 2013
271c647
update win32api getfileindex using win32io codes.
okahashi117 Nov 11, 2013
f53d48f
fix : scope bug
okahashi117 Nov 12, 2013
159e560
file seek function for win.
okahashi117 Nov 14, 2013
c1be8da
update seek function for win32.
okahashi117 Nov 14, 2013
223c94f
file pos function for win.
okahashi117 Nov 14, 2013
5273f53
file size function for win.
okahashi117 Nov 14, 2013
a2a16ac
minor bug fix and arrange codes.
okahashi117 Nov 14, 2013
acac78d
closed? function for win.
okahashi117 Nov 14, 2013
99eef07
read function for win.
okahashi117 Nov 14, 2013
a5fdb33
update read function for win.
okahashi117 Nov 14, 2013
342119c
ino(node) function for win.
okahashi117 Nov 15, 2013
9cc9c33
open function for win.
okahashi117 Nov 15, 2013
a85a189
use Win32File & Win32Io (important)
okahashi117 Nov 15, 2013
e5fd8d2
Update README.rdoc
okahashi117 Nov 18, 2013
92bdfe9
bug fix : wrong buf returned.
okahashi117 Nov 21, 2013
4a83158
set FILE_SHARE_DELETE as default in Win32File.open
okahashi117 Nov 21, 2013
066c921
fix bug: an error occurs at file rotation
okahashi117 Nov 30, 2013
7bb3f76
out_forward : SO_LINGER option looks not work on Windows
okahashi117 Dec 6, 2013
3a0ac15
gem packaged, anyway.
okahashi117 Dec 6, 2013
ca1e84e
Update README.rdoc
okahashi117 Dec 6, 2013
ba83a3e
in_tail : set FILE_SHARE_DELETE on as default
okahashi117 Dec 13, 2013
899342a
sorry, out_file does not work currently.
okahashi117 Dec 16, 2013
ebc9d12
in_tail : ino includes LPBYHANDLE.dwVolumeSerialNumber
okahashi117 Dec 17, 2013
9efe112
remove unused method : Win32File.getfileindex
okahashi117 Dec 17, 2013
588a6a5
Update README.rdoc
okahashi117 Dec 18, 2013
822aa53
for Windows platform.
MasayukiKiyota Jan 24, 2014
8e4dc9e
for Windows platform.
MasayukiKiyota Jan 28, 2014
f286910
bug fix: handling of inode(win) and pos-file was incorrect.
okahashi117 Jan 29, 2014
3e3b103
Add a function library file to handle Windows Event Object.(in future…
okahashi117 Jan 29, 2014
435c982
Windows : use win-native-event-object instead of INT SIGNAL.
okahashi117 Jan 29, 2014
cbe4e65
fix deployment mistake
okahashi117 Jan 29, 2014
dd74b91
Add windows service skelton file for fluentd.
okahashi117 Jan 29, 2014
bef7995
Support a command option to regist fluentd as Windows Service.
okahashi117 Jan 29, 2014
ec7c350
include win32-service to .gemspecs.
okahashi117 Jan 29, 2014
77897bc
Update README.rdoc
okahashi117 Jan 29, 2014
7ba1a39
Merge commit 'v0.10.42' into windows
MasayukiKiyota Feb 3, 2014
e4e7e4c
Update README.rdoc
MasayukiKiyota Feb 5, 2014
e4165d8
Update README.rdoc
MasayukiKiyota Feb 5, 2014
3ae22a5
Merge pull request #258 from MasayukiKiyota/windows
MasayukiKiyota Feb 10, 2014
b8988f0
fix : change an option paramenter for signame to '-x' .
okahashi117 Feb 19, 2014
6f8b171
fix : error at stopping windows service (0x42b)
okahashi117 Feb 19, 2014
a28c7f8
Update readme.
okahashi117 Feb 19, 2014
848d717
Update readme.
okahashi117 Feb 19, 2014
9a8e8fe
Update plugin condition and re-upload of 'Termination of fluentd'.
okahashi117 Feb 20, 2014
d85a38c
Merge 'master v0.10.46' into windows
MasayukiKiyota Apr 23, 2014
73b3d63
RUBY_INSTALL_DIR in env.rb was removed.
okahashi117 May 7, 2014
90cd888
RUBY_INSTALL_DIR in env.rb was removed.
MasayukiKiyota May 13, 2014
4a49afe
fix: invalid file seek position.
May 13, 2014
f362bf0
gem file upload
MasayukiKiyota May 13, 2014
5f71be9
fix ambiguous initialization for previous_seek.
May 13, 2014
5a20000
gem file include
MasayukiKiyota May 13, 2014
c58f335
Rollback previous changes.
May 13, 2014
1736275
Suppress automatically conversion EOL <-> CRLF.
May 13, 2014
6ef2b36
Merge pull request #319 from toruuetani/spike-windows-tail-invalid-seek
okahashi117 May 15, 2014
f44b248
Merge pull request #319 from toruuetani/spike-windows-tail-invalid-seek
MasayukiKiyota May 27, 2014
3d03b3f
Merge pull request #331 from MasayukiKiyota/windows
okahashi117 May 27, 2014
c9d84cf
Update README.md
okahashi117 Jun 3, 2014
ce4726e
update gem package.
okahashi117 Jun 14, 2014
29a9098
fix : handling of non existing file in in_tail
okahashi117 Jun 15, 2014
eabb228
Avoid a shutdown problem by killing main process.
okahashi117 Jun 21, 2014
2b6bb2d
To finish, KILL main process on Win7 or older.
okahashi117 Jun 25, 2014
6598a4a
fix incorrect invalid value for event_handle, nil for 0.
okahashi117 Jul 6, 2014
f0259ce
arrange codes.
okahashi117 Jul 7, 2014
e9d8a12
make work on Ruby 2.1
okahashi117 Dec 6, 2014
cfd5791
BugFix: in_tail read_from_head option does not work.
okahashi117 Jan 18, 2015
0a2a248
Better support for Windows Service.
okahashi117 Jan 26, 2015
71110f3
BugFix : SetEvent makes an error sometime when fluentd finish.
okahashi117 Jan 27, 2015
ca69b66
BugFix : Error at Windows service stopping.
okahashi117 Jan 27, 2015
8f1a868
just packaged as pkg/fluentd-0.10.46.win150316001.gem
okahashi117 Mar 16, 2015
0b4f269
fix: Fluent::Output#inspect may return too large object
nurse May 26, 2015
9960a40
Use IO#readpartial instead of read_nonblock
nurse May 26, 2015
bc9bb7f
Windows ignores SIGTERM; use SIGLILL instead
nurse May 26, 2015
f239933
Use portable null device notation: IO::NULL
nurse May 26, 2015
7d86aca
TCP Sockets needs shutdown before close
nurse May 26, 2015
eefe5b4
Windows doesn't support tzname by default
nurse May 26, 2015
0a7854f
Windows doesn't support symlink
nurse May 26, 2015
dbfae33
Windows doesn't support UNIXSocket
nurse May 26, 2015
0c32008
Try more concreate tempfile cleaning
nurse May 26, 2015
f6d04be
Use binary mode for patched ruby with FILE_SHARE_DELETE
nurse May 26, 2015
7aa990b
Merge branch 'windows' into v12-windows
nurse May 28, 2015
a8efe8d
$platformwin is not initialized yet
nurse Jun 2, 2015
04eb101
win32-api.gem 1.5.3 works on mswin64
nurse Jun 2, 2015
2b6609c
use --no-supervisor to get parent pid
nurse Jul 31, 2015
9f48f1b
unless doesn't get elsif
nurse Jul 31, 2015
1073aaa
main process catches event from supervisor
nurse Jul 31, 2015
2073786
fix to restart main process on unexpected death
nurse Aug 19, 2015
f91b589
Merge branch 'master' into v12-windows
nurse Sep 7, 2015
a4d2055
Merge branch 'master' into windows
nurse Sep 16, 2015
b9b07d8
lock flexmock's version
nurse Sep 18, 2015
d57fb39
require windows specific dependencies only on Windows
nurse Sep 18, 2015
157d86d
winfile is required by lib/fluent/load.rb
nurse Sep 18, 2015
ed7fbde
Use File as Win32File other than Windows
nurse Sep 18, 2015
f80aa3b
use $platformwin
nurse Sep 21, 2015
ef95906
Add appveyor.yml
nurse Sep 21, 2015
fc9ba35
fix indentation
nurse Sep 24, 2015
4197db4
fix typo
nurse Sep 24, 2015
acba044
fix around $platformwin
nurse Sep 24, 2015
ca38a23
Update msgpack
nurse Sep 24, 2015
789c0da
fix msgpack's version
nurse Sep 24, 2015
993d0f1
update test-unit.gem to avoid UndefinedConversionError
nurse Sep 25, 2015
95cfd07
add --platform=ruby
nurse Sep 25, 2015
c294c9e
chcp 65001 on appvryor
nurse Sep 25, 2015
19c16f2
Revert "add --platform=ruby"
nurse Sep 25, 2015
fa8b80b
Revert "chcp 65001 on appvryor"
nurse Sep 25, 2015
0e02a93
Add TESTOPTS=-v
nurse Sep 25, 2015
021f035
Revert "Add TESTOPTS=-v"
nurse Sep 25, 2015
effd60a
Tidy up DevKit
cosmo0920 Sep 19, 2015
10cc934
Specify build version format
cosmo0920 Sep 19, 2015
c25db50
Remove Ruby 2.0 32/64 bit jobs
cosmo0920 Sep 23, 2015
5357989
Add TESTOPTS=-v
nurse Sep 25, 2015
854a5b2
specify fixed test-unit.
nurse Sep 25, 2015
b27bee4
Add `--show-plugin-config` option
okkez Aug 25, 2015
f82edda
Use meaningful name
okkez Aug 25, 2015
c596fe9
Add test for Fluent::Config::ConfigureProxy#dump
okkez Aug 26, 2015
3817bf9
Retrieve default value properly
okkez Aug 26, 2015
fefec5b
Remove redundant backslashes
okkez Aug 26, 2015
24cdace
Add test for Fluent::Config::ConfigureProxy#dumptest using `config_se…
okkez Aug 26, 2015
676741d
Add line break after setup
okkez Aug 26, 2015
21e83ed
Add `:desc` option to `Fluent::Config::ConfigureProxy#config_param`
okkez Aug 26, 2015
e823cfc
Use suitable variable name
okkez Aug 26, 2015
1de3b0d
Display description added by `:desc` option
okkez Aug 26, 2015
e9c56ed
Use latest gems
nurse Sep 25, 2015
84cb0af
Use module instead of singleton class
nurse Sep 29, 2015
4448361
Move FLUENTD_WINSVC_NAME into if-clause
nurse Sep 29, 2015
b4726df
specify binary mode
nurse Sep 29, 2015
e9d5dab
Allow failure of 2.1 x86 on appveyor
nurse Sep 26, 2015
3996d5d
Use Fluent.windows? instead of $platformwin
nurse Oct 1, 2015
7ecec5e
Use Fluent.windows?
nurse Oct 3, 2015
166fee6
Remove useless code
nurse Oct 3, 2015
d9ef11b
move Windows specific command line options into if-clause
nurse Oct 6, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ test/config/tmp/*
make_dist.sh
Gemfile.local
.ruby-version
*.swp
coverage/*
25 changes: 25 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: '{build}'

install:
- SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
- "%devkit%\\devkitvars.bat"
- ruby --version
- gem --version
- bundle install
build: off
test_script:
- bundle exec rake test TESTOPTS=-v

environment:
matrix:
- ruby_version: "22-x64"
devkit: C:\Ruby21-x64\DevKit
- ruby_version: "22"
devkit: C:\Ruby21\DevKit
- ruby_version: "21-x64"
devkit: C:\Ruby21-x64\DevKit
- ruby_version: "21"
devkit: C:\Ruby21\DevKit
matrix:
allow_failures:
- ruby_version: "21"
12 changes: 9 additions & 3 deletions fluentd.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,25 @@ Gem::Specification.new do |gem|
gem.add_runtime_dependency("msgpack", [">= 0.5.11", "< 0.6.0"])
gem.add_runtime_dependency("json", [">= 1.4.3"])
gem.add_runtime_dependency("yajl-ruby", ["~> 1.0"])
gem.add_runtime_dependency("cool.io", [">= 1.2.2", "< 2.0.0"])
gem.add_runtime_dependency("cool.io", [">= 1.4.1", "< 2.0.0"])
gem.add_runtime_dependency("http_parser.rb", [">= 0.5.1", "< 0.7.0"])
gem.add_runtime_dependency("sigdump", ["~> 0.2.2"])
gem.add_runtime_dependency("tzinfo", [">= 1.0.0"])
gem.add_runtime_dependency("tzinfo-data", [">= 1.0.0"])
gem.add_runtime_dependency("string-scrub", [">= 0.0.3"])
if /mswin|mingw/ =~ RUBY_PLATFORM
gem.add_runtime_dependency("win32-service", ["~> 0.8.3"])
gem.add_runtime_dependency("win32-ipc", ["~> 0.6.1"])
gem.add_runtime_dependency("win32-event", ["~> 0.6.1"])
gem.add_runtime_dependency("windows-pr", ["~> 1.2.3"])
end

gem.add_development_dependency("rake", [">= 0.9.2"])
gem.add_development_dependency("flexmock")
gem.add_development_dependency("flexmock", ["~> 1.3.3"])
gem.add_development_dependency("parallel_tests", [">= 0.15.3"])
gem.add_development_dependency("simplecov", ["~> 0.6.4"])
gem.add_development_dependency("rr", [">= 1.0.0"])
gem.add_development_dependency("timecop", [">= 0.3.0"])
gem.add_development_dependency("test-unit", ["~> 3.0.2"])
gem.add_development_dependency("test-unit", ["~> 3.1.4"])
gem.add_development_dependency("test-unit-rr", ["~> 1.0.3"])
end
68 changes: 68 additions & 0 deletions lib/fluent/command/fluentd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@

require 'optparse'
require 'fluent/supervisor'
require 'fluent/log'
require 'fluent/env'
require 'fluent/version'
require 'windows/library'
include Windows::Library

$fluentdargv = Marshal.load(Marshal.dump(ARGV))

op = OptionParser.new
op.version = Fluent::VERSION
Expand All @@ -34,6 +41,10 @@
opts[:dry_run] = b
}

op.on('--show-plugin-config=PLUGIN', "Show PLUGIN configuration and exit(ex: input:dummy)") {|plugin|
opts[:show_plugin_config] = plugin
}

op.on('-p', '--plugin DIR', "add plugin directory") {|s|
opts[:plugin_dirs] << s
}
Expand Down Expand Up @@ -115,6 +126,19 @@
opts[:gem_install_path] = s
}

op.on('-x', '--signame INTSIGNAME', "an object name which is used for Windows Service signal (Windows only)") {|s|
opts[:signame] = s
}

op.on('--reg-winsvc MODE', "install/uninstall as Windows Service. (i: install, u: uninstall) (Windows only)") {|s|
opts[:regwinsvc] = s
}

op.on('--reg-winsvc-fluentdopt OPTION', "specify fluentd option paramters for Windows Service. (Windows only)") {|s|
opts[:fluentdopt] = s
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about showing above windows-only options only when Fluentd.windows? is true?


(class<<self;self;end).module_eval do
define_method(:usage) do |msg|
puts op.to_s
Expand Down Expand Up @@ -164,4 +188,48 @@
exit 0
end

if winsvcinstmode = opts[:regwinsvc]
FLUENTD_WINSVC_NAME="fluentdwinsvc"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines should be in inside if winsvcinstmode = opts[:regwinsvc] ?

FLUENTD_WINSVC_DISPLAYNAME="Fluentd Windows Service"
FLUENTD_WINSVC_DESC="Fluentd is an event collector system."
require 'fileutils'
require "win32/service"
require "win32/registry"
include Win32

case winsvcinstmode
when 'i'
binary_path = File.join(File.dirname(__FILE__), "..")
ruby_path = "\0" * 256
GetModuleFileName.call(0,ruby_path,256)
ruby_path = ruby_path.rstrip.gsub(/\\/, '/')

Service.create(
:service_name => FLUENTD_WINSVC_NAME,
:host => nil,
:service_type => Service::WIN32_OWN_PROCESS,
:description => FLUENTD_WINSVC_DESC,
:start_type => Service::DEMAND_START,
:error_control => Service::ERROR_NORMAL,
:binary_path_name => ruby_path+" -C "+binary_path+" winsvc.rb",
:load_order_group => "",
:dependencies => [""],
:display_name => FLUENTD_WINSVC_DISPLAYNAME
)
when 'u'
Service.delete(FLUENTD_WINSVC_NAME)
else
# none
end
exit 0
end

if fluentdopt = opts[:fluentdopt]
Win32::Registry::HKEY_LOCAL_MACHINE.open("SYSTEM\\CurrentControlSet\\Services\\fluentdwinsvc", Win32::Registry::KEY_ALL_ACCESS) do |reg|
reg['fluentdopt', Win32::Registry::REG_SZ] = fluentdopt
end
exit 0
end

require 'fluent/supervisor'
Fluent::Supervisor.new(opts).start
32 changes: 31 additions & 1 deletion lib/fluent/config/configure_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
module Fluent
module Config
class ConfigureProxy
attr_accessor :name, :final, :param_name, :required, :multi, :alias, :argument, :params, :defaults, :sections
attr_accessor :name, :final, :param_name, :required, :multi, :alias, :argument, :params, :defaults, :descriptions, :sections
# config_param :desc, :string, :default => '....'
# config_set_default :buffer_type, :memory
#
Expand Down Expand Up @@ -48,6 +48,7 @@ def initialize(name, opts = {})
@argument = nil # nil: ignore argument
@params = {}
@defaults = {}
@descriptions = {}
@sections = {}
end

Expand Down Expand Up @@ -157,6 +158,10 @@ def parameter_configuration(name, *args, &block)
config_set_default(name, opts[:default])
end

if opts.has_key?(:desc)
config_set_desc(name, opts[:desc])
end

[name, block, opts]
end

Expand Down Expand Up @@ -189,6 +194,17 @@ def config_set_default(name, defval)
nil
end

def config_set_desc(name, description)
name = name.to_sym

if @descriptions.has_key?(name)
raise ArgumentError, "#{self.name}: description specified twice for #{name}"
end

@descriptions[name] = description
nil
end

def config_section(name, *args, &block)
unless block_given?
raise ArgumentError, "#{self.name}: config_section requires block parameter"
Expand All @@ -208,6 +224,20 @@ def config_section(name, *args, &block)

name
end

def dump(level = 0)
dumped_config = "\n"
indent = " " * level
@params.each do |name, config|
dumped_config << "#{indent}#{name}: #{config[1][:type]}: <#{@defaults[name].inspect}>"
dumped_config << " # #{@descriptions[name]}" if @descriptions[name]
dumped_config << "\n"
end
@sections.each do |section_name, sub_proxy|
dumped_config << "#{indent}#{section_name}#{sub_proxy.dump(level + 1)}"
end
dumped_config
end
end
end
end
Expand Down
4 changes: 4 additions & 0 deletions lib/fluent/configurable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ def merged_configure_proxy
# p AnyGreatClass.dup.name #=> nil
configurables.map{ |a| a.configure_proxy(a.name || a.object_id.to_s) }.reduce(:merge)
end

def dump
configure_proxy_map[self.to_s].dump
end
end
end

Expand Down
2 changes: 2 additions & 0 deletions lib/fluent/load.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# ignore setup error on Win or similar platform which doesn't support signal
end
require 'cool.io'

$platformwin = /mswin|mingw/ === RUBY_PLATFORM
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From sada's comment on serverengine, how about using this approach like Fluent.on_windows? ? > treasure-data/serverengine#26 (comment)

We have fluent/env.rb so this file seems good place.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

require 'fluent/env'
require 'fluent/version'
require 'fluent/log'
Expand Down
2 changes: 2 additions & 0 deletions lib/fluent/output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ def secondary_init(primary)
$log.warn "type of secondary output should be same as primary output", :primary=>primary.class.to_s, :secondary=>self.class.to_s
end
end

def inspect; "#<%s:%014x>" % [self.class.name, '0x%014x' % (__id__<<1)] end
end


Expand Down
17 changes: 15 additions & 2 deletions lib/fluent/plugin/buf_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def initialize(key, path, unique_id, mode="a+", symlink_path = nil)
@path = path
@unique_id = unique_id
@file = File.open(@path, mode, DEFAULT_FILE_PERMISSION)
@file.binmode
@file.sync = true
@size = @file.stat.size
FileUtils.ln_sf(@path, symlink_path) if symlink_path
Expand Down Expand Up @@ -65,8 +66,20 @@ def open(&block)
end

def mv(path)
File.rename(@path, path)
@path = path
if defined?(Windows)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fluent.windows? is better?

pos = @file.pos
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems curious indentations....

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed!

@file.close
File.rename(@path, path)
@path = path
@file = File.open(@path, 'rb', DEFAULT_FILE_PERMISSION)
@file.sync = true
@size = @file.size
@file.pos = pos
@size = @file.stat.size
else
File.rename(@path, path)
@path = path
end
end
end

Expand Down
Loading