newLISP Fan Club

Forum => newLISP in the real world => Topic started by: HPW on April 27, 2016, 11:16:35 AM

Title: file-info on directorys
Post by: HPW on April 27, 2016, 11:16:35 AM
Hello,



Should file-info return the size of a Directory?

The doc is not clear.

And on windows it does not.


(file-info "C:/Temp")

(0 16895 2 0 0 1457865730 1457865730 1309073923)



Regards
Title: Re: file-info on directorys
Post by: Lutz on April 30, 2016, 11:40:03 AM
The file-info just reports the contents of the C stat() or fstat() function argument structure, without any processing.



There are subtle differences how structure fields are used on different platforms but this manual page for Linux perhaps gives you an Idea: http://man7.org/linux/man-pages/man2/stat.2.html . To figure out the size of a directory, you would have to write a function yourself, using file-info on all files in a directory.