kdomanski / iso9660

A go library for reading and creating ISO9660 images
BSD 2-Clause "Simplified" License
257 stars 43 forks source link

Add AddLocalFile function in image_writer #5

Closed chtisgit closed 4 years ago

chtisgit commented 4 years ago

AddLocalFile is for adding existing files in the filesystem to an ISO. It first tries to hardlink the file to the staging area which can provide speed-up. If hardlinking is not possible, it opens the specified file and calls AddFile().

Even if hardlinking is never possible, it saves a few lines of codes in many places because you don't need to handle the opening/closing of files yourself.

chtisgit commented 4 years ago

Thank you for pointing out the missing error handling. Looks good to me.