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

Thank you for your input. This is frustrating to me because this script DID work for many books, and only recently has it gone wonky. Hence my posting here.

Yes, the 'ls' is the OSX system command. Under that author here is what ls tells me:

ls -al "/Volumes/Backup3/httpd/public/local/fiction/data/Baldacci,Davi +d" -rw-r--r--@ 1 user admin 3115762 Feb 13 2019 End Game.epub drwxr-xr-x 6 user admin 204 May 30 2016 Saving Faith.epub

As you can see 'Saving Faith' is a directory, and only 204 bytes. But in Finder it shows up as 1MB and opens in iBooks.

As for other possibilities, I haven't altered the Apache config for years - if it works I leave it alone. No modules in there.

Something screwy in Skagway here :)

Replies are listed 'Best First'.
Re^3: copy an epub as a file, not a directory
by jcb (Parson) on Sep 12, 2019 at 23:09 UTC

    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".

      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.