Re: Number of files in folder problem

Antonio Cuni <[email protected]> Tue, 14 Jul 2020 11:48:28 +0200
Newsgroups gmane.comp.multimedia.gphoto.user
Message-ID <CAHPg78zN7uC089aY--2Ow+8foRrww6sTsCmLdYsoq6rbJToW+g@mail.gmail.com>
Hello Erturul,
you are not showing the full script, so it's hard to help.
Most likely, you are executing the command using os.system or
subprocess.<something>. In that case, the return value you get is not the
number of files but the exit code of the command (where 0 means "success").
But it's hard to say without seeing the relevant code.


On Sun, Jul 12, 2020 at 4:33 PM Erturul Sinan <[email protected]> wrote:

> Ladies and Genlemen,
>
> first of all, sorry for the disturbance.
>
> I have one question and I hope there is someone out there who can give me
> an answer.
>
> I am using the following command winthin a python script to filnd out how
> many in“mages are still on the SD-Card of the camera.
>
> *filesInFolder   = ["gphoto2", "--folder",
> "/store_00010001/DCIM/100NCD90", "--num-files"]*
>
> This command works fine and I get as an aswer "Number of files in folder
> '/store_001001/DCIM/100NCD90': 4"
>
> Since the command is assigned to a variable (*filesInFolder) *and when I
> try to print out he content of the variable with
>
> *print("Num Files = ", filesInFolder)*
>
> I get the message "Num Files = 0" . I cannot get access to the correct
> number of 4. How can I do that?
>
> Now my question is: How can I get access to the correct number of files
> (4) and assign it to a variable
> to get it printed out or to process it in further actions?
>
> Because 0 (zero) is definitive the wrong number.
>
> Thank you for your help. H A N D
>
> --
> Kind regards
>
>
> Erturul SINAN
> SinSoft - CSV & IT-Management
>
> Biebricher Allee 11
> D-65187 Wiesbaden
> GERMANY
>
> Mobile:	+49 - (0)178 - 400 97 55
> Mailto:	[email protected]
>
> Dissemination, distribution or copying of this e-mail or the information herein by anyone other than the intended recipient,
> or an employee or agent of a system responsible for delivering the message to the intended recipient, is prohibited.
>
> If you are not the intended recipient, please inform the sender and delete all copies and attachments.
>
> Thank you for your cooperation.
>
> _______________________________________________
> Gphoto-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/gphoto-user
>

_______________________________________________
Gphoto-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gphoto-user