1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2007-2008 - INRIA - Pierre MARECHAL <pierre.marechal@inria.fr>
4//
5//  This file is distributed under the same license as the Scilab package.
6// =============================================================================
7
8// <-- CLI SHELL MODE -->
9
10// =============================================================================
11// Determines if the path is an absolute name.
12// =============================================================================
13
14if is_absolute_path("test_1")                then pause,end
15if is_absolute_path("test_2       ")         then pause,end
16if is_absolute_path("	test_3		")       then pause,end
17
18if getos() == 'Windows' then
19
20	if is_absolute_path("/")                 then pause,end
21	if is_absolute_path("3:")                then pause,end
22	if is_absolute_path("c :")               then pause,end
23
24	if ~is_absolute_path("a:")               then pause,end
25	if ~is_absolute_path("A:")               then pause,end
26	if ~is_absolute_path("z:")               then pause,end
27	if ~is_absolute_path("Z:")               then pause,end
28	if ~is_absolute_path("  a:")             then pause,end
29	if ~is_absolute_path("	a:")             then pause,end
30
31else
32
33	if is_absolute_path("c:\")               then pause,end
34	if is_absolute_path("C:\")               then pause,end
35	if is_absolute_path("file:\")            then pause,end
36	if is_absolute_path("\test1")            then pause,end
37
38	if ~is_absolute_path("/test_11")         then pause,end
39	if ~is_absolute_path(" /test_12")        then pause,end
40	if ~is_absolute_path("	/test_13")       then pause,end
41	if ~is_absolute_path("~/test_14")        then pause,end
42	if ~is_absolute_path("       ~/test_15") then pause,end
43	if ~is_absolute_path("	~/test_16")      then pause,end
44
45end
46