On Fri, 15 Jun 2018 14:47:54 +0100, RobH declaimed the
following:
>When I commented out shutil and RAMxxx to NAsxxx, the script ran fine
>and took a video. When I then removed the comment from shutil and ran
>the script again, there was an error:
>
If you actually implemented what I was describing, the camera file
should be created directly on the NAS via the mount point, and you do not
want to try copying or deleting what results.]
>pi@raspberrypi:~/Downloads $ python intruder.py
>Traceback (most recent call last):
> File "intruder.py", line 37, in
> shutil.copyfile(RAMname, NASname)
> File "/usr/lib/python2.7/shutil.py", line 83, in copyfile
> with open(dst, 'wb') as fdst:
>IOError: [Errno 13] Permission denied:
>'/mnt/CCTV/PiZero/2018-06-15_14.40.14.h26
>
>This was picked up by the unlink line commented out, or however you
>would say it
>And a 0 byte file is copied to my NAS /PiZero directory.
>
Which sounds like it is creating the file entry in the directory, but
not copying data... But, again, if you made the changes I suggested, there
is no file in "RAMname" to be copied, and the file in "NASname" should
already exist (I don't know if copyfile() can replace an existing file).
>Now when I un commented out the unlink line, the script ran without
>error, and a video was written to the /mnt/CCTV/Pizero directory on the
>PiZero. No file was copied or moved to my NAS box PiZero directory
If the mount command worked, then "/mnt/CCTV/Pizero" (is that correct
-- Linux is case sensitive and in other places you use "PiZero"?) and the
NAS "PiZero" ARE THE SAME PHYSICAL DIRECTORY; any change in one should
appear in the other. At worst you might have to refresh any directory
display to see the changes (if you are using a GUI or web interface to view
the NAS).
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|