Re: [MERGE-REQUEST] `make-archive' and existing directories

[email protected] (Ludovic Courtès)
Newsgroups gmane.comp.version-control.arch.user
Organization LAAS-CNRS
Message-ID <[email protected]>
Hi Andy,

"Andy Tai" <[email protected]> writes:

> In light of  the previous comments in this thread, would Ludovic mind to
> modify the patch so it only creates an archive in an empty directory... or I
> will modify it to make tla to create the archive only if the preexisting
> directory is empty.

The issue is that this is not easily implementable.  The
`arch_pfs_vtable' doesn't have an `is_empty_directory ()' (or similar)
call, and using the `directory_files ()' call would yield too much
overhead (I'm guessing that this returns the list of files contained in
a directory).

On Unix-like file systems, checking whether a directory is empty can be
done efficiently by looking at the `st_nlink' field of `struct stat'.
However, I'm not sure similar features can be used over SFTP, HTTP,
etc.

Thus, I think we should just forget about this patch.

Thanks,
Ludovic.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.