@@ -112,6 +112,13 @@ bool __MCSFileCreateStream (MCStringRef p_native_path, intenum_t p_mode, MCStrea
112112 * Filesystem operations
113113 * ================================================================ */
114114
115+ enum MCSFileType
116+ {
117+ kMCSFileTypeRegular = (1 << 0 ),
118+ kMCSFileTypeDirectory = (1 << 1 ),
119+ kMCSFileTypeSymbolicLink = (1 << 5 ),
120+ };
121+
115122/* Delete the file at path. */
116123MC_DLLEXPORT bool MCSFileDelete (MCStringRef p_path);
117124
@@ -126,12 +133,17 @@ MC_DLLEXPORT bool MCSFileDeleteDirectory (MCStringRef p_path);
126133 * returned list never includes "." and "..". */
127134MC_DLLEXPORT bool MCSFileGetDirectoryEntries (MCStringRef p_path, MCProperListRef & r_entries);
128135
136+ /* Get the type of the file located at p_path. If p_follow_links is
137+ * true, dereferences symbolic links in p_path. */
138+ MC_DLLEXPORT bool MCSFileGetType (MCStringRef p_path, bool p_follow_links, MCSFileType & r_type);
139+
129140#ifdef __MCS_INTERNAL_API__
130141
131142bool __MCSFileDelete (MCStringRef p_native_path);
132143bool __MCSFileCreateDirectory (MCStringRef p_native_path);
133144bool __MCSFileDeleteDirectory (MCStringRef p_native_path);
134145bool __MCSFileGetDirectoryEntries (MCStringRef p_native_path, MCProperListRef & r_entries);
146+ bool __MCSFileGetType (MCStringRef p_native_path, bool p_follow_links, MCSFileType & r_type);
135147
136148#endif
137149
0 commit comments