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.
About Question enthuware.ocpjp.v11.2.3416 :
Moderator: admin
-
- Posts: 10
- Joined: Sat Aug 31, 2019 3:19 am
- Contact:
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v11.2.3416 :
No, 3 + 4 is not correct because as the comment to option 4 says, it is good to do but not helpful here.
-
- Posts: 10
- Joined: Sat Aug 31, 2019 3:19 am
- Contact:
Re: About Question enthuware.ocpjp.v11.2.3416 :
So maybe it would be better to rephrase the comment since it's not helpful regardless of if option 2 is chosen.
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v11.2.3416 :
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.
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.
-
- Posts: 13
- Joined: Tue Jul 21, 2020 1:39 pm
- Contact:
Re: About Question enthuware.ocpjp.v11.2.3416 :
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?
make sure that the number of lines in the file referred to by listOfFilesFile at //2 is within acceptable limit
without opening it?
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v11.2.3416 :
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.
Who is online
Users browsing this forum: No registered users and 3 guests