-
Notifications
You must be signed in to change notification settings - Fork 0
/
spm_existfile.m
27 lines (23 loc) · 1.03 KB
/
spm_existfile.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function s = spm_existfile(filename)
% Check if a file exists on disk - a compiled routine
% FORMAT s = spm_existfile(filename)
% filename - filename (can also be a relative or full pathname to a file)
% s - logical scalar, true if the file exists and false otherwise
%__________________________________________________________________________
%
% This compiled routine is equivalent to:
% >> s = exist(filename,'file') == 2;
% and was written for speed purposes. The differences in behaviour is that
% spm_existfile does not look in MATLAB's search path.
%__________________________________________________________________________
% Copyright (C) 2008-2012 Wellcome Trust Centre for Neuroimaging
% Guillaume Flandin
% $Id: spm_existfile.m 4901 2012-09-05 15:10:48Z guillaume $
%-This is merely the help file for the compiled routine
%error('spm_existfile.c not compiled - see Makefile')
persistent runOnce
if isempty(runOnce)
warning('spm_existfile is not compiled for your platform.');
runOnce = true;
end
s = exist(filename,'file') > 0;