2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
6 #include <aros/debug.h>
8 #include <dos/filesystem.h>
13 #include "__arosc_privdata.h"
15 #include "__filesystem_support.h"
19 /* like Dos_Lock() but no automatic soft link resolution */
24 /*****************************************************************************
37 Returns information about a file like stat does except that lstat
38 does not follow symbolic links. Information is stored in stat
39 structure. Consult stat() documentation for detailed description
43 path - Pathname of the file
44 sb - Pointer to stat structure that will be filled by the lstat() call.
47 0 on success and -1 on error. If an error occurred, the global
48 variable errno is set.
60 Consult stat() documentation for details.
62 ******************************************************************************/
67 /* check for empty path before potential conversion from "." to "" */
68 if (__doupath
&& path
&& *path
== '\0')
74 path
= __path_u2a(path
);
78 lock
= __lock(path
, SHARED_LOCK
);
81 if ( IoErr() == ERROR_IS_SOFT_LINK
82 || IoErr() == ERROR_OBJECT_IN_USE
)
84 /* either the file is already locked exclusively
85 or it is a soft link, in both cases only way
86 to get info about it is to find it in the
87 parent directory with the ExNext() function
91 return __stat_from_path(path
, sb
);
94 errno
= IoErr2errno(IoErr());
98 res
= __stat(lock
, sb
, FALSE
);
109 return Lock(name
, accessMode
);