[Tutor] File copying - best way?

alan.gauld@bt.com alan.gauld@bt.com
Sun, 5 Aug 2001 22:46:55 +0100

> "errno" useful also
> - but I have no clue how to use it.  Would this have allowed 
> me to test:
> os.popen("ls *.jpg")
> if it found no jpg files?

No. The reason being that in Unix 'ls' findng no files is 
NOT an error. 'ls' simply reports, quite accurately, the contents 
of a directory, if it's empty 'ls' returns am empty list! That's 
not an error. 'ls' will return an error if you ask it to list 
the contents of a non existent directory however.

In that case the errno() stuff might be useful to you...

Alan g