On Mon, Mar 17, 2008 at 10:25 AM, David Bateman
<[EMAIL PROTECTED]> wrote:
> Jaroslav Hajek wrote:
>  > hi,
>  >
>  > for those (like me) who find checking for file existence via
>  > stat/lstat a little inconvenient, I've committed a new function
>  > "ftest"
>  > in main/io, somewhat modelled after the bash "test" function. For
>  > example, to check
>  > that a regular file ./script.sh exists and is readable and executable
>  > to the current user, one does:
>  > ftest('./script.sh','f','rx')
>  >
>  > regards,
>  >
>  >
>  What is wrong with
>
>  exist (file, "file")
>
>  to test for the existence of a file? Or is the fact that exist also
>  searches the users path an issue?
>

I think that sometimes it could be. exist is clearly intended for
different purpose (checking for function and script files available).
For instance, I may want to test for the file "test" in current
directory, and exist ("test", "file")
would surprise me...
Moreover, there's the ability of fexist to check for r/w/x which is
often useful.


>  D.
>
>
>  --
>  David Bateman                                [EMAIL PROTECTED]
>  Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph)
>  Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob)
>  91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax)
>
>  The information contained in this communication has been classified as:
>
>  [x] General Business Information
>  [ ] Motorola Internal Use Only
>  [ ] Motorola Confidential Proprietary
>
>



-- 
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to