o
    *Thn  ã                   @   s   d dl Z dedefdd„ZdS )é    NÚ	directoryÚreturnc                 C   sR   d}t  | ¡D ]\}}}|D ]}t j ||¡}t j |¡s%|t j |¡7 }qq|S )a   
    Calculate the total size of the directory by walking through each file.

    Parameters:
    directory (str): The path of the directory for which to calculate the size.

    Returns:
    total_size (int): The total size of the directory in bytes.
    r   )ÚosÚwalkÚpathÚjoinÚislinkÚgetsize)r   Ú
total_sizeÚdirpathÚ_Ú	filenamesÚfÚfp© r   úY/home/air/segue/gemini/back/venv/lib/python3.10/site-packages/chromadb/utils/directory.pyÚget_directory_size   s   
€ür   )r   ÚstrÚintr   r   r   r   r   Ú<module>   s    