Re: [IO] Suggestion for AbstractFileComparator

2023-12-01 Thread Miguel Muñoz
@Elliotte Rusty Harold, ​I'd like to make two unrelated points. ​ ​1. I wasn't suggesting the missingFilesFirst() or missingFilesLast() methods as a solution to the issues raised in IO-813 LastModifiedFileComparator should not throw exceptions, period. I just thought these met

Re: [IO] Suggestion for AbstractFileComparator

2023-12-01 Thread Elliotte Rusty Harold
I'm not sure we need two methods here, or even one. We simply need to detect a missing file and assign it a time like Integer.MIN_INT. Make the behavior as reproducible as reasonable for the case where the file doesn't exist and never existed. For cases where the last modified time changes or a fi

Re: [IO] Suggestion for AbstractFileComparator

2023-12-01 Thread Miguel Muñoz
Good question. Since the missingFilesFirst/Last() methods would most likely be ​used for sorting, I'm going to ​assume ​your "ls -type" command sorts the ​files at ​some point. I'll assume it's by last-modified, to put more ​recent files first. ​ ​Without calling the missingFile

Re: [IO] Suggestion for AbstractFileComparator

2023-12-01 Thread Gary Gregory
Hi Miguel, I like the idea but I think we need a use case, even if it's one we can only write about here, otherwise we are making everything more complicated. For example, if implementing an "ls"-type, command, a UI, or an app configuration, what would be best for a user? Let's say some files di

[IO] Suggestion for AbstractFileComparator

2023-12-01 Thread Miguel Muñoz
In my comments about issue IO-813 LastModifiedFileComparator should not throw exceptions, period, I made a suggestion that I thought I'd repeat here. I was thinking of adding these two methods to AbstractFileComparator. ​ ​public static Comparator missingFilesFirst(Compa