/*
	rulehunter - A server to find rules in data based on user specified goals
	Copyright (C) 2016 vLife Systems Ltd <http://vlifesystems.com>

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU Affero General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU Affero General Public License for more details.

	You should have received a copy of the GNU Affero General Public License
	along with this program; see the file COPYING.  If not, see
	<http://www.gnu.org/licenses/>.
*/

package fileinfo

import "time"

// FileInfo represents a file name and modified time
type FileInfo interface {
	Name() string
	ModTime() time.Time
}

// IsEqual returns if two FileInfo objects are equal
func IsEqual(a, b FileInfo) bool {
	return a.Name() == b.Name() && a.ModTime() == b.ModTime()
}

/*
	rulehunter - A server to find rules in data based on user specified goals
	Copyright (C) 2016 vLife Systems Ltd <http://vlifesystems.com>

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU Affero General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU Affero General Public License for more details.

	You should have received a copy of the GNU Affero General Public License
	along with this program; see the file COPYING.  If not, see
	<http://www.gnu.org/licenses/>.
*/

package fileinfo

import "time"

// FileInfo represents a file name and modified time
type FileInfo interface {
	Name() string
	ModTime() time.Time
}

// IsEqual returns if two FileInfo objects are equal
func IsEqual(a, b FileInfo) bool {
	return a.Name() == b.Name() && a.ModTime().Equal(b.ModTime())
}

Use Equal() to compare FileInfo time
Use Equal() to compare FileInfo time

This is because on some systems it is necessary to accurately compare
time.
