Re: [PATCH] Create a symbolic link as a regular file on filesystems without symlinks.
- From
Johannes Sixt <johannes.sixt@telecom.at>
- Date
- Feb 28, 2007, 17:18 UTC
- Message-ID
- <200702281818.52668.johannes.sixt@telecom.at>
- In-Reply-To
- <Pine.LNX.4.63.0702272342160.22628@wbgn013.biozentrum.uni-wuerzburg.de>
On Tuesday 27 February 2007 23:44, Johannes Schindelin wrote:
Show 5 quoted lines
> On Tue, 27 Feb 2007, Johannes Sixt wrote: > > - if (S_ISLNK(mode)) > > + if (trust_symlink_fmt && S_ISLNK(mode)) > > First of all why "_fmt"? I would have called it "trust_symlinks".
Because the file type is encoded in a mask named S_IFMT ;) But the more I think about it, I'll rename it to has_symlinks.
Show 13 quoted lines
> Wouldn't this be better:
>
> - if (to_tempfile) {
> - strcpy(path, ".merge_link_XXXXXX");
> - fd = mkstemp(path);
> + if (to_tempfile || !trusk_symlink_fmt) {
> + if (to_tempfile) {
> + strcpy(path, ".merge_link_XXXXXX");
> + fd = mkstemp(path);
> + } else
> + fd = create_file(path, 0666);
>
> Hmm?Sure; it amounts to the same, but is shorter.
-- Hannes