summaryrefslogtreecommitdiff
path: root/src/Scilab2C/GeneralFunctions/SCI2Cfileexist.sci
diff options
context:
space:
mode:
authorpmarecha2008-06-05 08:49:05 +0000
committerpmarecha2008-06-05 08:49:05 +0000
commit42659d6cdbe63972aea27baf0289db8fcc1310fa (patch)
tree05cc1eb42b985cf657be112ae5a2e842a13c2126 /src/Scilab2C/GeneralFunctions/SCI2Cfileexist.sci
parentc4ca26eb9d2bbe224e41fc40658279cb865c48fc (diff)
downloadscilab2c-42659d6cdbe63972aea27baf0289db8fcc1310fa.tar.gz
scilab2c-42659d6cdbe63972aea27baf0289db8fcc1310fa.tar.bz2
scilab2c-42659d6cdbe63972aea27baf0289db8fcc1310fa.zip
SVN is not FTP !
Diffstat (limited to 'src/Scilab2C/GeneralFunctions/SCI2Cfileexist.sci')
-rw-r--r--src/Scilab2C/GeneralFunctions/SCI2Cfileexist.sci28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Scilab2C/GeneralFunctions/SCI2Cfileexist.sci b/src/Scilab2C/GeneralFunctions/SCI2Cfileexist.sci
new file mode 100644
index 00000000..87cc1777
--- /dev/null
+++ b/src/Scilab2C/GeneralFunctions/SCI2Cfileexist.sci
@@ -0,0 +1,28 @@
+function ExistTest = SCI2Cfileexist(InDir,FileName)
+// function ExistTest = SCI2Cfileexist(InDir,FileName)
+// -----------------------------------------------------------------
+// Searches for the file FileName in the directory InDir.
+// Return %F if it doesn't exist.
+//
+// Input data:
+//
+// Output data:
+//
+// Status:
+// 12-Jun-2007 -- Nutricato Raffaele: Author.
+// -----------------------------------------------------------------
+
+tmppwd = pwd();
+cd(InDir);
+allfiles = ls(FileName);
+cd(tmppwd);
+
+if (size(allfiles,1) == 0)
+ ExistTest = %F;
+elseif (size(allfiles,1) == 1)
+ ExistTest = %T;
+else
+ SCI2Cerror('Very Strange! Found more than one file with the same name.');
+end
+
+endfunction