[Scilab-users] File exist function?

Claus Futtrup cfuttrup at gmail.com
Thu Jan 25 20:55:14 CET 2018


Hi Antoine

isfile() looks like exactly what I wish for. I suppose then, this is the
correct ("most official") way to do it in Scilab.

Thanks!

Best regards,
Claus

On Thu, Jan 25, 2018 at 7:40 PM, Antoine ELIAS <
antoine.elias at scilab-enterprises.com> wrote:

> Hello Claus,
>
> You can use "isfile" function to check existence if a file and "isdir" for
> folder.
> https://help.scilab.org/docs/6.0.0/en_US/isfile.html
> https://help.scilab.org/docs/6.0.0/en_US/isdir.html
> <https://help.scilab.org/docs/6.0.0/en_US/isfile.html>
>
> Regards,
> Antoine
>
> Le 25/01/2018 à 17:43, Claus Futtrup a écrit :
>
> Dear Scilabers
>
> I wish to check for the existence of some files. For this I created a
> simple function:
>
> [out]=function file_exist(fname)
>     [fd, err] = mopen(fname); // Try to open file, mode: 'br' (binary-reading)
>     if err==0 then
>         out=%t;
>         mclose(fname);
>     else
>         out=%f
>     endendfunction
>
>
> I didn't check, but presumably this would work.
>
> Is such a function already available? Which way is the "official" way to
> do this in Scilab?
>
> Maybe I'm searching for the wrong word, but I found some ways in Scilab.
> The "fileinfo" seems to be the closest one to what I wish to do.
>
> Matlab has a function "exist()" which can check for files too. Scilab has
> the function "exists()" - notice the function name is plural, not singluar
> - and this one AFAIK only works for Scilab variables (not files), although
> I didn't check.
>
> If fileinfo is the right way, maybe an example for the help could be to
> make a file_exist function, to show ... (?) ... when I search for Scilab
> file exist function, I'm not guided in any specific way/direction and find
> myself insecure whether I find the right help.
>
> Best regards,
> Claus
>
>
> _______________________________________________
> users mailing listusers at lists.scilab.orghttp://lists.scilab.org/mailman/listinfo/users
>
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20180125/0cf0b969/attachment.htm>


More information about the users mailing list