• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Errata, Sybex CSG 17, Chapter 14

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, I think there's an error in answer to question 4

Question:
For which values of path sent to this method would it be possible for the following code to
output Success? (Choose all that apply.)
...
B. path refers to a symbolic link in the file system.
...

In Answers section it is said that

If the method were corrected to declare the appropriate exceptions <...> Option B would also be correct if the method were provided a symbolic link that pointed to an empty directory


But in Files.deleteIfExists javadoc it is said that

If the file is a symbolic link, then the symbolic link itself, not the final target of the link, is deleted.


I have tested this on my Windows 10 and got the same result: the program deleted a symlink to non-empty directory
 
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ooh! You're right. Added to the errata
 
He was expelled for perverse baking experiments. This tiny ad is a model student:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic