in reply to Re^2: copy an epub as a file, not a directory
in thread copy an epub as a file, not a directory

Did it stop working after an OSX update? As I mentioned in another reply, MacOS X plays games like this.

The actual epub file is probably in that directory somewhere, so you will need to improve your Perl script to check if the "file" that it has been asked to copy is actually a directory (the -d file test operator should help here) and, if so, search within to locate the actual file and copy the real file and not the Apple "file".

Replies are listed 'Best First'.
Re^4: copy an epub as a file, not a directory
by Anonymous Monk on Sep 13, 2019 at 00:56 UTC

    I'm not sure about the OSX updates. This machine can't get beyond High Sierra 10.13.6, and I haven't seen any security updates for a while.

    Looking at the file via Finder -> Show Package Contents shows me a typical epub layout with files and directories.

    When I check the file with -d, it comes back positive as a directory, but of course searching within it does not show me a single file.

    I'm beginning to wonder if the original epub file has something compromised.

      Looking at the file via Finder -> Show Package Contents shows me a typical epub layout with files and directories. When I check the file with -d, it comes back positive as a directory, but of course searching within it does not show me a single file. I'm beginning to wonder if the original epub file has something compromised.

      If you can "Show Package Contents" on an "epub" then you are dealing with an application, not an epub file. I would inspect that package very carefully before running it. Maybe it's a self-reading epub app or maybe it's posing as epub for less benign reasons.

        Yes, that does seem very odd. Yet it appears as a genuine epub file. I have since acquired a different copy of that epub, and Finder no longer has 'Show View Options'. However, when it does get copied to my web directory, I still cannot click on it to download it!

        Safari errors out:

        The requested URL /fiction/data/Baldacci,David/Saving Faith.epub/ was +not found on this server.

        I need to find out where the trailing front-slash is coming from.