[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 3/9] OssTest: Add target_dir_exists

Konrad Rzeszutek Wilk writes ("Re: [PATCH v2 3/9] OssTest: Add 
> On Tue, Dec 13, 2016 at 04:24:56PM +0000, Ian Jackson wrote:
> > Konrad Rzeszutek Wilk writes ("[PATCH v2 3/9] OssTest: Add 
> > target_dir_exists"):
> > > We have target_file_exists but not an equivalant one for directories.
> > > This adds it in and is used in the "ts-xen-build: Make {xen|}dist.tar.gz
> > > only if $builddir/install/{$xen|}install" patch.
> > 
> > Do you care about the distinction between a file and a directory ?
> Yes. I just need to mke sure that the directory exists, while there
> may be multiple files (in it).

No, that wasn't what I meant.  I meant: do you actually need to test
whether the name you are giving to the test refers to a directory, or
simply to tell whether it exists ?

The distinction is only relevant if the object might also
non-erroneously be a file.  (If it's erroneously a file, and you
proceed as if it's a directory, you will crash later.)

> > IOW I don't understand why target_file_exists wouldn't do.
> > 
> > If you think the word "file" in its name is confusing, please feel
> > free to add a doc comment or to rename that function.
> The functions are pretty similar. The file one does 'test -e' while
> this one does 'test -d'.

test -e tests for general existence of things.  I think test -e would
do for you in this case.


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.