Page 1 of 1

About Question enthuware.ocpjp.v11.2.3416 :

Posted: Thu Apr 08, 2021 12:15 pm
by bouke.nijhuis
There is a correct option that says:

Check the number of lines in the file referred to by listOfFilesFile at //2 before proceeding to open the files.

I think checking is not enough, you should also act on this information. So IMHO this answer is a little vague.

Re: About Question enthuware.ocpjp.v11.2.3416 :

Posted: Thu Apr 08, 2021 9:03 pm
by admin
You are right. Updated the option to make it clear.
thank you for your feedback!

Re: About Question enthuware.ocpjp.v11.2.3416 :

Posted: Mon Apr 12, 2021 5:26 am
by marcioggs
According to the comment on option 4, can we assume that both (2 and 3) or (3 and 4) are correct?

Although it would be good to close an open file as soon as its use is over, but if the total number of open files is limited using option 2, the given code is fine.

Re: About Question enthuware.ocpjp.v11.2.3416 :

Posted: Mon Apr 12, 2021 5:29 am
by admin
No, 3 + 4 is not correct because as the comment to option 4 says, it is good to do but not helpful here.

Re: About Question enthuware.ocpjp.v11.2.3416 :

Posted: Mon Apr 12, 2021 5:41 am
by marcioggs
So maybe it would be better to rephrase the comment since it's not helpful regardless of if option 2 is chosen.

Re: About Question enthuware.ocpjp.v11.2.3416 :

Posted: Mon Apr 12, 2021 6:51 am
by admin
Yes, that's what the comment to option 4 says, "Although it would be good to close an open file as soon as its use is over, but if the total number of open files is limited using option 2, the given code is fine." This clearly implies that 4 is not useful.
Also, you asked about (2 and 3) or (3 and 4). Not 2 + 4.

2+4 is not correct because you need 2 as well as 3.

Re: About Question enthuware.ocpjp.v11.2.3416 :

Posted: Tue Apr 20, 2021 3:26 am
by 61d14837
How do you
make sure that the number of lines in the file referred to by listOfFilesFile at //2 is within acceptable limit
without opening it?

Re: About Question enthuware.ocpjp.v11.2.3416 :

Posted: Tue Apr 20, 2021 4:03 am
by admin
There could be several ways depending on OS, depending on the environment in which the program is running, depending on the resources available. May be it is a configurable limit and the program should compare with that limit.