Line data Source code
1 : !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2 : !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 : !!!! !!!!
4 : !!!! ParaMonte: Parallel Monte Carlo and Machine Learning Library. !!!!
5 : !!!! !!!!
6 : !!!! Copyright (C) 2012-present, The Computational Data Science Lab !!!!
7 : !!!! !!!!
8 : !!!! This file is part of the ParaMonte library. !!!!
9 : !!!! !!!!
10 : !!!! LICENSE !!!!
11 : !!!! !!!!
12 : !!!! https://github.com/cdslaborg/paramonte/blob/main/LICENSE.md !!!!
13 : !!!! !!!!
14 : !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
15 : !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16 :
17 : !> \brief
18 : !> This file contains procedure implementations of [pm_sysPath](@ref pm_sysPath).
19 : !>
20 : !> \finmain
21 : !>
22 : !> \author
23 : !> \FatemehBagheri, Wednesday 12:20 AM, October 13, 2021, Dallas, TX
24 :
25 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26 :
27 : submodule (pm_sysPath) routines ! LCOV_EXCL_LINE
28 :
29 : #if CHECK_ENABLED
30 : use pm_err, only: getFine
31 : use pm_val2str, only: getStr
32 : use pm_err, only: setAsserted
33 : #define ERROR_STOP_IF(FAILED,MSG) if (FAILED) error stop MSG
34 : #define CHECK_ASSERTION(LINE,ASSERTION,MSG) \
35 : call setAsserted(ASSERTION,getFine(__FILE__,LINE)//MODULE_NAME//MSG);
36 : #else
37 : #define ERROR_STOP_IF(FAILED,MSG)
38 : #define CHECK_ASSERTION(LINE,ASSERTION,MSG) continue;
39 : #endif
40 :
41 : use, intrinsic :: iso_c_binding, only: c_int32_t, c_char, c_null_char
42 : use pm_os, only: isWindows, isLinux, isDarwin
43 : use pm_sysShell, only: shellis_type, shell_type
44 : use pm_sysShell, only: isFailedGetOutput
45 : use pm_sysShell, only: isFailedGetEnvVar
46 : use pm_arrayReplace, only: getReplaced
47 : use pm_arrayReplace, only: setReplaced
48 : use pm_arrayInsert, only: setInserted
49 : use pm_arrayRemove, only: getRemoved
50 : use pm_arrayResize, only: setResized
51 : use pm_sysShell, only: isFailedExec
52 : use pm_strASCII, only: isCharAlpha
53 : use pm_strASCII, only: setStrLower
54 : use pm_strASCII, only: getStrLower
55 : use pm_arraySplit, only: setSplit
56 : use pm_container, only: css_type
57 : use pm_str, only: isEndedWith
58 : use pm_str, only: getCharVec
59 : use pm_val2str, only: getStr
60 :
61 : implicit none
62 :
63 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
64 :
65 : contains
66 :
67 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
68 : !
69 : ! module procedure constructPathList
70 : ! use pm_kind, only: SKC => SK
71 : ! use pm_val2str, only: getStr
72 : ! use pm_sysShell, only: shellis_type
73 : ! character(*, SK), parameter :: PROCEDURE_NAME = MODULE_NAME//SK_"@constructPathList()"
74 : ! character(:, SK), allocatable :: command
75 : ! !logical(LK) :: namesorted, datesorted, sizesorted
76 : !
77 : ! type(shellis_type) :: shellis
78 : ! if (present(failed) .and. present(errmsg)) then
79 : ! shellis = shellis_type(failed, errmsg)
80 : ! errmsg = MODULE_NAME//SK_"@constructPathList(): "//trim(errmsg)
81 : ! if (failed) return ! LCOV_EXCL_LINE
82 : ! elseif (present(failed)) then
83 : ! shellis = shellis_type(failed)
84 : ! if (failed) return ! LCOV_EXCL_LINE
85 : ! else
86 : ! shellis = shellis_type()
87 : ! end if
88 : !
89 : ! ! Determine sorting method.
90 : !
91 : ! if (present(sort)) then
92 : ! if (sort == SK_"name") then
93 : ! namesorted = .true._LK
94 : ! datesorted = .false._LK
95 : ! sizesorted = .false._LK
96 : ! elseif (sort == SK_"date") then
97 : ! namesorted = .false._LK
98 : ! datesorted = .true._LK
99 : ! sizesorted = .false._LK
100 : ! elseif (sort == SK_"date") then
101 : ! namesorted = .false._LK
102 : ! datesorted = .true._LK
103 : ! sizesorted = .false._LK
104 : ! else
105 : ! if (present(failed)) then
106 : ! failed = .true._LK
107 : ! if (present(errmsg)) errmsg = PROCEDURE_NAME//SK_": Unrecognized value for the `sort` input argument: "//getStr(sort)
108 : ! else
109 : ! error stop PROCEDURE_NAME//SK_": Unrecognized value for the `sort` input argument: "//getStr(sort)
110 : ! end if
111 : ! end if
112 : ! end if
113 : !
114 : ! ! Determine item types to list
115 : !
116 : ! ! Generate the list of items
117 : !
118 : ! ! `ls` flags:
119 : ! ! -a, --all : do not ignore entries starting with `.`.
120 : ! ! -Q, --quote-name : enclose entry names in double quotes.
121 : ! ! -A, --almost-all : do not list implied `.` and `..`.
122 : ! ! -b, --escape : print C-style escapes for nongraphic characters.
123 : ! ! -c with -lt : sort by, and show, ctime (time of last modification of file status information); with -l: show ctime and sort by name; otherwise: sort by ctime, newest first.
124 : ! ! -F, --classify : append indicator (one of */=>@|) to entries. Display
125 : ! ! -# a slash (/) immediately after each pathname that is a directory,
126 : ! ! -# an asterisk (`*') after each that is executable,
127 : ! ! -# an at sign (`@') after each symbolic link,
128 : ! ! -# a percent sign (`%') after each whiteout,
129 : ! ! -# an equal sign (`=') after each socket,
130 : ! ! -# avertical bar (`|') after each that is a FIFO.
131 : ! ! --group-directories-first : group directories before files; can be augmented with a `--sort` option, but any use of `--sort=none` (`-U`) disables grouping.
132 : ! ! -h, --human-readable : with -l and -s, print sizes like 1K 234M 2G etc.
133 : ! ! -k, --kibibytes : default to 1024-byte blocks for disk usage; used only with `-s` and per directory totals.
134 : ! ! -m : fill width with a comma separated list of entries.
135 : ! ! -Q, --quote-name : enclose entry names in double quotes.
136 : ! ! --quoting-style=WORD : use quoting style WORD for entry names: `literal`, `locale`, `shell`, `shell-always`, `shell-escape`, `shell-escape-always`, `c`, `escape` (overrides QUOTING_STYLE environment variable)
137 : ! ! -r, --reverse : reverse order while sorting
138 : !
139 : !
140 : ! if (shellis%posix .or. shellis%fish) then
141 : ! if (namesorted)
142 : ! command = "ls -b"
143 : ! elseif (shellis%windows) then
144 : ! else
145 : ! if (present(failed)) then
146 : ! failed = .true._LK
147 : ! if (present(errmsg)) errmsg = PROCEDURE_NAME//SK_": Unrecognized runtime shell."
148 : ! else
149 : ! error stop PROCEDURE_NAME//SK_": Unrecognized runtime shell."
150 : ! end if
151 : ! end if
152 : !
153 : ! end procedure
154 : !
155 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
156 :
157 : #define getPathMatch_ENABLED 1
158 :
159 32 : module procedure getPathMatch
160 : use pm_kind, only: SKC => SK
161 : #include "pm_sysPath@routines.inc.F90"
162 64 : end procedure
163 :
164 : #undef getPathMatch_ENABLED
165 :
166 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
167 :
168 : #define setPathMatch_ENABLED 1
169 :
170 44 : module procedure setPathMatch
171 : use pm_kind, only: SKC => SK
172 : #include "pm_sysPath@routines.inc.F90"
173 2900 : end procedure
174 :
175 : #undef setPathMatch_ENABLED
176 :
177 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
178 :
179 : #define isDir_ENABLED 1
180 :
181 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
182 :
183 : #define DD_ENABLED 1
184 :
185 623 : module procedure isDirDD
186 : use pm_kind, only: SKC => SK
187 : #include "pm_sysPath@routines.inc.F90"
188 623 : end procedure
189 :
190 : #undef DD_ENABLED
191 :
192 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
193 :
194 : #define II_ENABLED 1
195 :
196 2993 : module procedure isDirII
197 : use pm_kind, only: SKC => SK
198 : #include "pm_sysPath@routines.inc.F90"
199 2993 : end procedure
200 :
201 : #undef II_ENABLED
202 :
203 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
204 :
205 : #undef isDir_ENABLED
206 :
207 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
208 :
209 : #define isFile_ENABLED 1
210 :
211 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
212 :
213 : #define DD_ENABLED 1
214 :
215 399 : module procedure isFileDD
216 : use pm_kind, only: SKC => SK
217 : #include "pm_sysPath@routines.inc.F90"
218 399 : end procedure
219 :
220 : #undef DD_ENABLED
221 :
222 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
223 :
224 : #define II_ENABLED 1
225 :
226 2381 : module procedure isFileII
227 : use pm_kind, only: SKC => SK
228 : #include "pm_sysPath@routines.inc.F90"
229 2381 : end procedure
230 :
231 : #undef II_ENABLED
232 :
233 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
234 :
235 : #undef isFile_ENABLED
236 :
237 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
238 :
239 : #define isExtant_ENABLED 1
240 :
241 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
242 :
243 : #define DD_ENABLED 1
244 :
245 40 : module procedure isExtantDD
246 : use pm_kind, only: SKC => SK
247 : #include "pm_sysPath@routines.inc.F90"
248 40 : end procedure
249 :
250 : #undef DD_ENABLED
251 :
252 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
253 :
254 : #define II_ENABLED 1
255 :
256 2381 : module procedure isExtantII
257 : use pm_kind, only: SKC => SK
258 : #include "pm_sysPath@routines.inc.F90"
259 2381 : end procedure
260 :
261 : #undef II_ENABLED
262 :
263 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
264 :
265 : #undef isExtant_ENABLED
266 :
267 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
268 :
269 48 : module procedure getPathVerbatim
270 :
271 : use pm_kind, only: SKC => SK
272 : use pm_sysShell, only: shellis_type
273 :
274 : type(shellis_type) :: shellis
275 48 : if (present(failed) .and. present(errmsg)) then
276 0 : shellis = shellis_type(failed, errmsg)
277 0 : errmsg = MODULE_NAME//SK_"@getPathVerbatim(): "//trim(errmsg)
278 : if (failed) return ! LCOV_EXCL_LINE
279 48 : elseif (present(failed)) then
280 0 : shellis = shellis_type(failed)
281 : if (failed) return ! LCOV_EXCL_LINE
282 : else
283 48 : shellis = shellis_type()
284 : end if
285 :
286 : ! The order of the following conditions must be preserved.
287 : !print *, shellis
288 48 : if (shellis%powershell) then
289 0 : pathVerbatim = getPathVerbatimPowerShell(path)
290 48 : elseif (shellis%posix) then
291 48 : pathVerbatim = getPathVerbatimPosix(path)
292 0 : elseif (shellis%fish) then
293 : pathVerbatim = getPathVerbatimFish(path) ! LCOV_EXCL_LINE
294 0 : elseif (shellis%cmd) then ! .and. shellis%windows) then
295 : pathVerbatim = getPathVerbatimCMD(path) ! LCOV_EXCL_LINE
296 0 : elseif (present(failed)) then
297 : failed = .true._LK ! LCOV_EXCL_LINE
298 : if (present(errmsg)) errmsg = MODULE_NAME//SK_"@getPathVerbatim(): Failed to infer the runtime shell type." ! LCOV_EXCL_LINE
299 : else
300 : error stop MODULE_NAME//SK_"@getPathVerbatim(): Failed to infer the runtime shell type." ! LCOV_EXCL_LINE
301 : end if
302 :
303 96 : end procedure
304 :
305 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
306 :
307 : #define getIndexDirName_ENABLED 1
308 :
309 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
310 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
311 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
312 :
313 : #define Def_ENABLED 1
314 :
315 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
316 :
317 277 : module procedure getIndexDirNameDef
318 : use pm_kind, only: SKC => SK
319 : #include "pm_sysPath@routines.inc.F90"
320 : end procedure
321 :
322 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
323 :
324 : #undef Def_ENABLED
325 :
326 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
327 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
328 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
329 :
330 : #define PM_ENABLED 1
331 :
332 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
333 :
334 177 : module procedure getIndexDirNamePM
335 : use pm_kind, only: SKC => SK
336 : #include "pm_sysPath@routines.inc.F90"
337 177 : end procedure
338 :
339 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
340 :
341 : #undef PM_ENABLED
342 :
343 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
344 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
345 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
346 :
347 : #undef getIndexDirName_ENABLED
348 :
349 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
350 :
351 : #define getDirName_ENABLED 1
352 :
353 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
354 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
355 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
356 :
357 : #define Def_ENABLED 1
358 :
359 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
360 :
361 205 : module procedure getDirNameDef
362 : use pm_kind, only: SKC => SK
363 : #include "pm_sysPath@routines.inc.F90"
364 205 : end procedure
365 :
366 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
367 :
368 : #undef Def_ENABLED
369 :
370 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
371 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
372 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
373 :
374 : #define PM_ENABLED 1
375 :
376 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
377 :
378 177 : module procedure getDirNamePM
379 : use pm_kind, only: SKC => SK
380 : #include "pm_sysPath@routines.inc.F90"
381 177 : end procedure
382 :
383 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
384 :
385 : #undef PM_ENABLED
386 :
387 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
388 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
389 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
390 :
391 : #undef getDirName_ENABLED
392 :
393 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
394 :
395 : #define getIndexBaseName_ENABLED 1
396 :
397 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
398 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
399 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
400 :
401 : #define Def_ENABLED 1
402 :
403 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
404 :
405 244 : module procedure getIndexBaseNameDef
406 : use pm_kind, only: SKC => SK
407 : #include "pm_sysPath@routines.inc.F90"
408 244 : end procedure
409 :
410 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
411 :
412 : #undef Def_ENABLED
413 :
414 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
415 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
416 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
417 :
418 : #define PM_ENABLED 1
419 :
420 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
421 :
422 176 : module procedure getIndexBaseNamePM
423 : use pm_kind, only: SKC => SK
424 : #include "pm_sysPath@routines.inc.F90"
425 176 : end procedure
426 :
427 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
428 :
429 : #undef PM_ENABLED
430 :
431 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
432 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
433 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
434 :
435 : #undef getIndexBaseName_ENABLED
436 :
437 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
438 :
439 : #define getBaseName_ENABLED 1
440 :
441 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
442 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
443 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
444 :
445 : #define Def_ENABLED 1
446 :
447 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
448 :
449 164 : module procedure getBaseNameDef
450 : use pm_kind, only: SKC => SK
451 : #include "pm_sysPath@routines.inc.F90"
452 164 : end procedure
453 :
454 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
455 :
456 : #undef Def_ENABLED
457 :
458 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
459 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
460 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
461 :
462 : #define PM_ENABLED 1
463 :
464 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
465 :
466 176 : module procedure getBaseNamePM
467 : use pm_kind, only: SKC => SK
468 : #include "pm_sysPath@routines.inc.F90"
469 176 : end procedure
470 :
471 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
472 :
473 : #undef PM_ENABLED
474 :
475 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
476 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
477 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
478 :
479 : #undef getBaseName_ENABLED
480 :
481 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
482 : !
483 : ! module procedure getIndexBaseName
484 : ! integer(IK) :: offset
485 : ! GET_OFFSET ! fpp
486 : ! indexBaseName = scan(path(1 : offset-1), dirsep, back = .true., kind = IK) + 1_IK
487 : ! end procedure
488 : !
489 : ! !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
490 : !
491 : ! module procedure getIndexBaseNamePM
492 : ! indexBaseName = scan(path(1:len(path,IK)), dirsep, back = .true., kind = IK) + 1_IK
493 : ! end procedure
494 : !
495 : !!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
496 : !
497 : ! module procedure getBaseName
498 : ! use pm_kind, only: SKC => SK
499 : ! integer(IK) :: offset
500 : ! integer(IK) :: lenPath
501 : ! lenPath = len(path, IK)
502 : ! if (lenPath > 1_IK) then
503 : ! GET_OFFSET ! fpp
504 : ! basename = path(getIndexBaseName(path(1 : offset), dirsep): offset)
505 : ! else
506 : ! basename = path
507 : ! end if
508 : ! end procedure
509 : !
510 : ! !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
511 : !
512 : ! module procedure getBaseNamePM
513 : ! if (asis) then
514 : ! basename = path(getIndexBaseName(path, dirsep, asis):)
515 : ! else
516 : ! basename = getBaseName(path, dirsep)
517 : ! end if
518 : ! end procedure
519 : !
520 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
521 :
522 36 : module procedure getExtName
523 36 : extname = path(getIndexExtName(path, dirsep):)
524 36 : end procedure
525 :
526 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
527 :
528 36 : module procedure getFileName
529 36 : filename = path(getIndexBaseName(path, dirsep) : getIndexExtName(path, dirsep) - 1_IK)
530 36 : end procedure
531 :
532 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
533 :
534 144 : module procedure getIndexExtName
535 : use pm_kind, only: SKC => SK
536 144 : indexExtName = len(path, IK)
537 144 : if (indexExtName > 0_IK) then
538 336 : loopSearch: do
539 464 : if (path(indexExtName:indexExtName) == SKC_".") then
540 64 : return
541 400 : elseif (path(indexExtName:indexExtName) == dirsep .or. indexExtName == 1_IK) then
542 64 : indexExtName = len(path, IK) + 1_IK
543 64 : return
544 : end if
545 336 : indexExtName = indexExtName - 1_IK
546 : end do loopSearch
547 : else
548 16 : indexExtName = indexExtName + 1_IK
549 : end if
550 16 : end procedure
551 :
552 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
553 : #if 0
554 : module procedure getPathDensePosix
555 : use pm_kind, only: SKC => SK
556 : character(*,SKC), parameter :: PSP = DIR_SEP_POSIX
557 : character(*,SKC), parameter :: CDIR = PSP//"."//PSP ! current dir pattern.
558 : character(*,SKC), parameter :: PDIR = PSP//".."//PSP ! parent dir pattern.
559 : integer(IK) :: istart, iend, j, lenPath
560 : lenPath = len(path, IK)
561 : allocate(character(lenPath,SKC) :: pathDense)
562 : CHECK_ASSERTION(__LINE__, len(PSP, IK) == 1_IK, SK_"@getPathDensePosix(): Posix directory separator must be a single character.")
563 : istart = 1_IK
564 : iend = istart
565 : do
566 : if (iend < lenPath - 2_IK) then
567 : if (path(i:i+1) == CDIR) then
568 : i = i + 2_IK
569 : elseif (path(i:i+1_IK) == "/../"//PSP) then
570 : i = i + 3_IK
571 : end if
572 : else
573 : exit
574 : end if
575 : end do
576 : if (lenPath > 3_IK) then
577 : elseif (lenPath == 3_IK) then
578 : if (
579 : elseif (lenPath == 2_IK) then
580 : elseif (lenPath == 1_IK) then
581 : end if
582 : end procedure
583 : #endif
584 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
585 :
586 44 : module procedure getPathAbs
587 : logical(LK) :: failed
588 : character(2047, SK) :: errmsg
589 44 : errmsg = SK_""
590 44 : pathAbs = getPathAbs(path, failed, errmsg)
591 44 : if (failed) error stop MODULE_NAME//SK_"@getPathAbs(): "//trim(errmsg)
592 44 : end procedure
593 :
594 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
595 :
596 0 : module procedure getPathAbsFailed
597 : character(2047, SK) :: errmsg
598 0 : errmsg = SK_""
599 0 : pathAbs = getPathAbs(path, failed, errmsg)
600 0 : end procedure
601 :
602 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
603 :
604 61 : module procedure getPathAbsFailedMsg
605 :
606 : use pm_sysShell, only: isFailedGetOutput
607 : use pm_sysShell, only: shellis_type
608 : use pm_kind, only: SKC => SK
609 : type(shellis_type) :: shellis
610 :
611 61 : failed = .false._LK
612 61 : blockNonEmptyPath: if (len(path,IK) > 0_IK) then
613 : !#if INTEL_ENABLED
614 : ! ! Try the intel compiler approach.
615 : ! ! \warning
616 : ! ! The extension `FullPathQQ()` is apparently sensitive to last dirsep,
617 : ! ! causing a doubling of the basename of the input `path` if it ends with a dirsep.
618 : ! ! For now, the bypass is to avoid the use of this Intel compiler extension as its behavior seems ambiguous.
619 : ! block
620 : ! use ifport, only: FullPathQQ
621 : ! integer(IK) :: lenPath
622 : ! allocate(character(MAX_LEN_FILE_PATH,SKC) :: pathAbs)
623 : ! lenPath = FullPathQQ(path, pathAbs)
624 : ! if (0_IK < lenPath) then
625 : ! pathAbs = pathAbs(1 : lenPath)
626 : ! return
627 : ! end if
628 : ! !failed = logical(lenPath > 0_IK, LK)
629 : ! !if (failed) errmsg = MODULE_NAME//SK_"@getPathAbsFailedMsg(): Failed to resolve the input path." ! LCOV_EXCL_LINE
630 : ! ! try other methods
631 : ! end block
632 : !#endif
633 51 : shellis = shellis_type(failed, errmsg)
634 :
635 : ! Try the Microsoft PowerShell approach.
636 :
637 51 : if (shellis%powershell .or. shellis%cmd) then
638 : ! LCOV_EXCL_START
639 : block
640 :
641 : !logical(LK) :: endsWithNLC
642 : !character(1,SKC) :: APPENDIX = SKC_" "
643 : character(:,SKC), allocatable :: command
644 : character(*,SKC), parameter :: NLC = new_line(SKC_"a")
645 :
646 : ! \warning
647 : ! The presence of trailing new line character in the input path can be problematic when the absolute path is inferred via Microsoft PowerShell.<br>
648 : ! By default, the procedures of this generic interface strip any leading or trailing new line characters via the call to [isFailedGetOutput](@ref pm_sysShell::isFailedGetOutput).<br>
649 : ! This issue becomes relevant only if Microsoft PowerShell Core is the default runtime shell on a POSIX-compliant shell, which is as of 2022 almost never the case.
650 : ! Update: The above behavior of `isFailedGetOutput()` was a bug that is now resolved. As such, this discussion is irrelevant.
651 :
652 : !endsWithNLC = logical(path(len(path, IK) - len(NLC, IK) + 1_IK :) == NLC, LK)
653 : !if (endsWithNLC) APPENDIX = SKC_"X" ! ensure the significant new line character is not stripped incorrectly by `isFailedGetOutput()`.
654 :
655 : ! The order of the conditionals in the following should not change (powershell must be first).
656 :
657 : if (shellis%powershell) then
658 : !command = SKC_"$ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath('"//path//trim(APPENDIX)//SKC_"')" ! LCOV_EXCL_LINE
659 : command = SKC_"$ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath('"//path//SKC_"')" ! LCOV_EXCL_LINE
660 : elseif (shellis%cmd) then
661 : !command = SKC_"powershell -command ""$ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath('"//path//trim(APPENDIX)//SKC_"')""" ! LCOV_EXCL_LINE
662 : command = SKC_"powershell -command ""$ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath('"//path//SKC_"')""" ! LCOV_EXCL_LINE
663 : end if
664 :
665 : failed = isFailedGetOutput(command, pathAbs, errmsg)
666 : !if (failed) errmsg = MODULE_NAME//SK_"@getPathAbsFailedMsg(): Failed to fetch powershell command output. "//trim(errmsg) ! LCOV_EXCL_LINE
667 : if (.not. failed) return
668 : !if (.not. failed) then
669 : ! if (endsWithNLC) pathAbs = pathAbs(1 : len(path, IK) - 1)
670 : ! return
671 : !end if
672 :
673 : end block
674 : ! LCOV_EXCL_STOP
675 : end if
676 :
677 : ! Try the POSIX realpath() approach.
678 : ! The realpath() approach is too complex and involved and its result is not compatible with the Windows approach (that does not resolve symlinks).
679 : !#if !WINDOWS_ENABLED
680 : !! The Unix fencing is required because `realpath` does not exist on Windows OS.
681 : !elseif (shellis%posix) then
682 : ! block
683 : ! use, intrinsic :: iso_c_binding, only: c_ptr, c_null_ptr, c_null_char, c_associated
684 : ! character(*,SKC), parameter :: PSP = DIR_SEP_POSIX
685 : ! character(:,SKC), allocatable :: relPathStr, absPathStr
686 : ! integer(IK) , parameter :: NTRY = 8_IK ! max number of times extending the buffer.
687 : ! integer(IK) :: absPathLen, maxPathLen, itry
688 : ! type(c_ptr) :: ptr
689 : ! interface
690 : ! function realpath(path,resolved_path) result(absPathStrPtr) bind(c, name = "realpath")
691 : ! use, intrinsic :: iso_c_binding
692 : ! character(1, c_char), intent(in) :: path(*)
693 : ! character(1, c_char), intent(out) :: resolved_path(*)
694 : ! type(c_ptr) :: absPathStrPtr
695 : ! end function realpath
696 : ! end interface
697 : ! ERROR _STOP _IF(DIR_SEP_POSIX /= DIR_SEP_POSIX_ALL, SK_"@isPathAbsPosix(): Internal error occurred. `DIR_SEP_POSIX == DIR_SEP_POSIX_ALL` must hold."
698 : ! if (isPathAbsPosix(path)) then; pathAbs = path; return; end if
699 : ! relPathStr = getPathDense(path, PSP) ! no compacting should be done as it can destroy symlinks.
700 : ! loopFindExistingDirName: do
701 : ! maxPathLen = 1024_IK
702 : ! loopSufficientPathLen: do itry = 1_IK, NTRY
703 : ! absPathStr = repeat(SKC_" ", maxPathLen)
704 : ! absPathStrPtr = realpath(relPathStr//c_null_char, absPathStr)
705 : ! ! Determine the first null char
706 : ! do absPathLen = 1_IK, maxPathLen
707 : ! if(absPathStr(absPathLen:absPathLen) /= c_null_char) cycle
708 : ! absPathLen = absPathLen - 1_IK
709 : ! exit
710 : ! end do
711 : ! if (absPathLen < maxPathLen) exit loopSufficientPathLen
712 : ! maxPathLen = maxPathLen * 2_IK
713 : ! end do loopSufficientPathLen
714 : ! failed = itry > NTRY
715 : ! if (failed) then
716 : ! errmsg = MODULE_NAME//SK_"@getPathAbsFailedMsg(): Failed to detect the null character in the output of realpath(). This is highly unusual." ! LCOV_EXCL_LINE
717 : ! ptr = c_null_ptr ! LCOV_EXCL_LINE
718 : ! return ! LCOV_EXCL_LINE
719 : ! end if
720 : ! if (c_associated(absPathStrPtr)) exit loopFindExistingDirName
721 : ! end do loopFindExistingDirName
722 : ! ptr = c_null_ptr
723 : ! end block
724 : !#endif
725 :
726 : ! Ensure the input non-empty path is indeed relative.
727 :
728 51 : if (isPathAbsPosix(path) .or. (shellis%windows .and. isPathAbsWindows(path))) then
729 8 : pathAbs = path
730 8 : return
731 : end if
732 :
733 : end if blockNonEmptyPath
734 :
735 : ! We get here only if the input path is empty or all other approaches have failed.
736 :
737 0 : block
738 : character(:,SKC), allocatable :: dirc
739 : character(1,SKC), parameter :: PSP = DIR_SEP_POSIX
740 : character(1,SKC), parameter :: PSW = DIR_SEP_WINDOWS
741 53 : dirc = getDirCurrent(failed, errmsg)
742 106 : if (.not. failed) then
743 53 : if (len(path, IK) == 0_IK) then
744 10 : pathAbs = dirc
745 43 : elseif (shellis%windows) then
746 0 : pathAbs = dirc//PSW//path
747 : else
748 43 : pathAbs = dirc//PSP//path
749 : end if
750 53 : return
751 : end if
752 : end block
753 :
754 : ERROR_STOP_IF(.not. failed, MODULE_NAME//SK_"@getPathAbsFailedMsg(): Internal library error: The program should have failed by this point.")
755 : errmsg = MODULE_NAME//SK_"@getPathAbsFailedMsg(): "//trim(errmsg) ! LCOV_EXCL_LINE
756 0 : pathAbs = path
757 :
758 122 : end procedure
759 :
760 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
761 :
762 12 : module procedure getDirCurrent
763 : character(2047, SK) :: errmsg
764 : logical(LK) :: failed
765 12 : dirCurrent = getDirCurrent(failed, errmsg)
766 12 : if (failed) error stop MODULE_NAME//SK_"@getDirCurrent(): "//trim(errmsg)
767 12 : end procedure
768 :
769 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
770 :
771 17 : module procedure getDirCurrentFailed
772 : use pm_kind, only: SKC => SK
773 : #if INTEL_ENABLED || GNU_ENABLED
774 : #if INTEL_ENABLED
775 : use ifport, only: getcwd
776 : #endif
777 : use pm_arrayResize, only: setResized
778 : integer(IK) :: dirCurrentLen
779 17 : dirCurrentLen = 127_IK
780 17 : do
781 34 : call setResized(dirCurrent, dirCurrentLen)
782 : ! This yields an ICE with gfortran on macOS arm64 M2.
783 : ! It seems like external routines `getcwd()` cannot be passed directly to intrinsic functions.
784 : ! failed = logical(getcwd(dirCurrent) /= 0, LK)
785 34 : failed = getcwd(dirCurrent) /= 0
786 34 : if (.not. failed) exit
787 17 : if (MAX_LEN_FILE_PATH < dirCurrentLen) return
788 17 : dirCurrentLen = 2_IK * (dirCurrentLen + 1_IK)
789 17 : cycle
790 : end do
791 : if (failed) then
792 : dirCurrent = SKC_"."
793 : else
794 17 : dirCurrent = trim(dirCurrent)
795 : end if
796 : #else
797 : character(2047, SK) :: errmsg
798 : dirCurrent = getDirCurrent(failed, errmsg)
799 : #endif
800 17 : end procedure
801 :
802 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
803 :
804 69 : module procedure getDirCurrentFailedMsg
805 : ! the environment variables CD and perhaps PWD are unreliable and may not be defined. Use the command form instead.
806 : use pm_sysShell, only: isFailedGetOutput
807 : use pm_sysShell, only: shellis_type
808 : use pm_kind, only: SKC => SK
809 : type(shellis_type) :: shellis
810 69 : shellis = shellis_type(failed, errmsg)
811 69 : if (shellis%powershell) then
812 0 : failed = isFailedGetOutput(SKC_"echo (pwd).path", dirCurrent, errmsg)
813 69 : elseif (shellis%posix .or. shellis%fish) then
814 69 : failed = isFailedGetOutput(SKC_"pwd", dirCurrent, errmsg)
815 0 : elseif (shellis%cmd) then
816 0 : failed = isFailedGetOutput(SKC_"cd", dirCurrent, errmsg)
817 : end if
818 69 : if (failed) then
819 : errmsg = MODULE_NAME//SK_"@getDirCurrent(): Failed to fetch `pwd` command output. "//trim(errmsg) ! LCOV_EXCL_LINE
820 : dirCurrent = SKC_"." ! LCOV_EXCL_LINE
821 : end if
822 69 : end procedure
823 :
824 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
825 :
826 40 : module procedure getDirHome
827 : use pm_kind, only: SKC => SK
828 : use pm_val2str, only: getStr
829 : use pm_sysShell, only: shellis_type
830 : use pm_sysShell, only: isFailedGetEnvVar, isFailedGetOutput
831 40 : character(:,SKC), allocatable :: homeDrive, homePath, user_def
832 : character(*,SKC), parameter :: PSWA = DIR_SEP_WINDOWS_ALL
833 : character(*,SKC), parameter :: PSPA = DIR_SEP_POSIX_ALL
834 : character(*,SKC), parameter :: PSW = DIR_SEP_WINDOWS
835 : character(*,SKC), parameter :: PSP = DIR_SEP_POSIX
836 : character(:, SK), allocatable :: errmsg_def
837 : logical(LK) :: failed_def
838 : type(shellis_type) :: shellis
839 :
840 40 : if (present(errmsg)) then
841 20 : allocate(errmsg_def, source = errmsg)
842 : else
843 20 : allocate(character(1023, SK) :: errmsg_def)
844 : end if
845 :
846 40 : shellis = shellis_type(failed_def, errmsg_def)
847 :
848 : ! Get the Home directory
849 :
850 40 : failed_def = isFailedGetEnvVar(SK_"HOME", dirHome, errmsg_def) ! Assume Posix shell or PowerShell Core.
851 40 : failed_def = failed_def .or. logical(len_trim(dirHome, IK) == 0_IK, LK)
852 40 : if (failed_def) then ! assume Windows PowerShell or CMD.
853 : ! LCOV_EXCL_START
854 : if (shellis%cmd .or. shellis%powershell) then
855 : failed_def = isFailedGetEnvVar(SK_"USERPROFILE", dirHome, errmsg_def) ! Windows PowerShell and CMD
856 : failed_def = failed_def .or. logical(len_trim(dirHome, IK) == 0_IK, LK)
857 : if (failed_def) then
858 : failed_def = isFailedGetEnvVar(SK_"HOMEDRIVE", homeDrive, errmsg_def) ! Windows PowerShell and CMD
859 : failed_def = failed_def .or. logical(len_trim(homeDrive, IK) == 0_IK, LK)
860 : if (.not. failed_def) then
861 : failed_def = isFailedGetEnvVar(SK_"HOMEPATH", homePath, errmsg_def) ! Windows PowerShell and CMD
862 : failed_def = failed_def .or. logical(len_trim(homePath, IK) == 0_IK, LK)
863 : if (.not. failed_def) dirHome = homeDrive//homePath
864 : end if
865 : end if
866 : end if
867 : ! LCOV_EXCL_STOP
868 : end if
869 :
870 : ! If successful, replace username with the requested user name.
871 :
872 40 : if (.not. failed_def) then
873 40 : failed_def = .not. isDir(dirHome)
874 40 : if (failed_def) then
875 0 : errmsg_def(:) = SK_"The identified current user home directory does not exist: """//getStr(dirHome)//SK_""""
876 40 : elseif (present(user)) then
877 : !failed_def = logical(len_trim(user) == 0, LK)
878 : !if (failed_def) then
879 : ! errmsg_def(:) = SK_"The input user name must not be empty."
880 : !else
881 24 : if (len_trim(user, IK) > 0_IK) then ! substitute username only if the requested username is non-empty.
882 12 : if (shellis%posix .or. shellis%fish) then
883 12 : dirHome = getDirName(dirHome, PSPA)//PSP//user
884 0 : elseif (shellis%windows) then
885 0 : dirHome = getDirName(dirHome, PSWA)//PSW//user
886 : end if
887 : end if
888 : end if
889 : !write(*,*) "dirHome"
890 : !write(*,*) "dirHome"
891 : !write(*,*) dirHome, failed_def, present(user), isDir(dirHome)
892 : !if (present(user)) write(*,*) user
893 0 : elseif (shellis%posix .or. shellis%fish) then ! try another way on posix shells (including PowerShell Core) and Fish.
894 0 : if (present(user)) then ! Fetch the username first.
895 0 : user_def = user
896 : else
897 0 : failed_def = isFailedGetEnvVar(SK_"USER", user_def, errmsg_def)
898 0 : failed_def = failed_def .or. logical(len_trim(user_def) == 0, LK)
899 0 : if (failed_def) then
900 0 : failed_def = isFailedGetEnvVar(SK_"USERNAME", user_def, errmsg_def)
901 0 : failed_def = failed_def .or. logical(len_trim(user_def, IK) == 0_IK, LK)
902 0 : if (failed_def) failed_def = isFailedGetOutput(SK_"whoami", user_def, errmsg_def)
903 : end if
904 : end if
905 0 : failed_def = failed_def .or. logical(len_trim(user_def, IK) == 0_IK, LK)
906 0 : if (.not. failed_def) then
907 0 : failed_def = isFailedGetOutput(SK_'getent passwd "'//user_def//SK_'" | cut -d: -f6', dirHome, errmsg_def) ! Get the user-specific path.
908 0 : failed_def = failed_def .or. logical(len_trim(dirHome, IK) == 0_IK, LK)
909 : end if
910 : end if
911 :
912 40 : if (failed_def) then
913 : dirHome = SK_"" ! LCOV_EXCL_LINE
914 : errmsg_def = MODULE_NAME//SK_"@getDirHome(): Failed to fetch the home directory. "//trim(errmsg_def) ! LCOV_EXCL_LINE
915 : end if
916 :
917 : if (present(errmsg)) errmsg = errmsg_def ! LCOV_EXCL_LINE
918 :
919 40 : if (present(failed)) then
920 24 : failed = failed_def
921 16 : elseif (failed_def) then
922 : error stop trim(errmsg_def) ! LCOV_EXCL_LINE
923 : end if
924 :
925 40 : deallocate(errmsg_def) ! gfortran 11 automatic heap deallocation bug.
926 :
927 80 : end procedure
928 :
929 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
930 :
931 12 : module procedure getPathExpandedUser
932 : character(2047, SK) :: errmsg
933 : logical(LK) :: failed
934 12 : pathExpandedUser = getPathExpandedUser(path, failed, errmsg)
935 12 : if (failed) error stop MODULE_NAME//SK_"@getPathExpandedUser(): "//trim(errmsg)
936 12 : end procedure
937 :
938 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
939 :
940 8 : module procedure getPathExpandedUserFailed
941 : character(2047, SK) :: errmsg
942 8 : pathExpandedUser = getPathExpandedUser(path, failed, errmsg)
943 8 : end procedure
944 :
945 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
946 :
947 24 : module procedure getPathExpandedUserFailedMsg
948 : use pm_kind, only: SKC => SK
949 : use pm_sysShell, only: shellis_type
950 : character(*,SKC), parameter :: PSPA = DIR_SEP_POSIX_ALL
951 : character(*,SKC), parameter :: PSWA = DIR_SEP_WINDOWS_ALL
952 : type(shellis_type) :: shellis
953 : integer(IK) :: lenPath
954 : integer(IK) :: firstDirSepPos
955 24 : failed = .false._LK
956 24 : lenPath = len(path, IK)
957 24 : if (lenPath > 0_IK) then
958 20 : if (path(1:1) == SKC_"~") then
959 16 : shellis = shellis_type(failed, errmsg)
960 16 : if (.not. failed) then
961 16 : if (shellis%posix .or. shellis%fish) then
962 16 : firstDirSepPos = scan(path(1:lenPath), PSPA, kind = IK)
963 : else
964 0 : firstDirSepPos = scan(path(1:lenPath), PSWA, kind = IK)
965 : end if
966 16 : if (firstDirSepPos == 0_IK) firstDirSepPos = lenPath + 1_IK
967 16 : pathExpandedUser = getDirHome(path(2:firstDirSepPos-1), failed = failed, errmsg = errmsg) // path(firstDirSepPos:lenPath)
968 : return
969 : end if
970 : end if
971 : end if
972 8 : pathExpandedUser = path
973 48 : end procedure
974 :
975 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
976 :
977 4 : module procedure isFailedChangeDir
978 : ! \warning : The input `dir` must be of default character kind.
979 : #if INTEL_ENABLED
980 : use ifport, only: chdir
981 : #endif
982 : #if INTEL_ENABLED || GNU_ENABLED
983 : ! This **could** yield an ICE with gfortran on macOS like the other above.
984 : ! failed = logical(chdir(dir) /= 0, LK)
985 4 : failed = chdir(dir) /= 0
986 : #else
987 : use iso_c_binding, only: c_null_char, c_int
988 : #if WINDOWS_ENABLED
989 : interface ! See WIN32 API for details of `_chdir`, `_wchdir`. `chdir` is deprecated
990 : function chdir(path) result(stat) bind(C, name = "_chdir")
991 : use iso_c_binding, only: c_char, c_int
992 : character(1, c_char), intent(in) :: path(*)
993 : integer(c_int) :: stat
994 : end function
995 : end interface
996 : #else
997 : interface
998 : function chdir(path) result(stat) bind(C, name = "chdir")
999 : use iso_c_binding, only: c_char, c_int
1000 : character(1,c_char), intent(in) :: path(*)
1001 : integer(c_int) :: stat
1002 : end function
1003 : end interface
1004 : #endif
1005 : failed = logical(chdir(dir//c_null_char) /= int(0,c_int), LK)
1006 : #endif
1007 4 : end procedure
1008 :
1009 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1010 :
1011 40 : module procedure getPathTemp
1012 : use pm_sysShell, only: isFailedGetDirTemp
1013 40 : if (isFailedGetDirTemp(pathTemp) .and. allocated(pathTemp)) deallocate(pathTemp)
1014 184 : pathTemp = getPathNew(pathTemp, prefix, sep, ext, pid, failed)
1015 40 : end procedure
1016 :
1017 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1018 :
1019 145 : module procedure getPathNew
1020 :
1021 : use pm_kind, only: SKC => SK
1022 : use pm_val2str, only: getStr
1023 : use pm_sysShell, only: shellis_type
1024 : use pm_parallelism, only: getImageID
1025 :
1026 : character(1,SKC), parameter :: USC = SKC_"_"
1027 : character(*,SKC), parameter :: PSP = DIR_SEP_POSIX
1028 : character(*,SKC), parameter :: PSW = DIR_SEP_WINDOWS
1029 : character(*,SKC), parameter :: PSPA = DIR_SEP_POSIX_ALL
1030 : character(*,SKC), parameter :: PSWA = DIR_SEP_WINDOWS_ALL
1031 : character(:,SKC), allocatable :: dir_def, prefix_def, ext_def
1032 : integer(IK) , parameter :: COUNTER_MAX = 1000_IK
1033 : integer(IK) :: counter, lenDir
1034 : integer(IK) :: pid_def
1035 : logical(LK) :: exists
1036 : type(shellis_type) :: shellis
1037 : character(8 ,SKC) :: date
1038 : character(10,SKC) :: time
1039 :
1040 :
1041 145 : if (present(failed)) then
1042 36 : shellis = shellis_type(failed)
1043 36 : if (failed) then
1044 : pathNew = SKC_"" ! LCOV_EXCL_LINE
1045 : return ! LCOV_EXCL_LINE
1046 : end if
1047 : else
1048 109 : shellis = shellis_type()
1049 : end if
1050 :
1051 145 : if (present(dir)) then
1052 104 : if (len_trim(dir, IK) > 0_IK) then
1053 104 : lenDir = len(dir, IK)
1054 104 : if (shellis%windows .and. scan(PSWA, dir(lenDir:lenDir), kind = IK) == 0_IK) then
1055 0 : dir_def = dir//PSW
1056 104 : elseif (scan(PSPA, dir(lenDir:lenDir), kind = IK) == 0_IK) then
1057 84 : dir_def = dir//PSP
1058 : else
1059 20 : dir_def = dir
1060 : end if
1061 : else
1062 0 : dir_def = SKC_""
1063 : end if
1064 : else
1065 41 : dir_def = SKC_""
1066 : end if
1067 :
1068 145 : if (present(prefix)) then
1069 104 : prefix_def = prefix
1070 : else
1071 41 : if (present(sep)) then
1072 0 : prefix_def = SKC_"new"//sep
1073 : else
1074 41 : prefix_def = SKC_"new"//USC
1075 : end if
1076 : end if
1077 :
1078 145 : if (present(ext)) then
1079 24 : ext_def = ext
1080 : else
1081 121 : ext_def = SKC_""
1082 : end if
1083 :
1084 145 : if (present(pid)) then
1085 24 : pid_def = pid
1086 : else
1087 121 : pid_def = getImageID()
1088 : end if
1089 :
1090 :
1091 145 : do counter = 1_IK, COUNTER_MAX
1092 145 : call date_and_time(date, time)
1093 145 : if (present(sep)) then
1094 12 : pathNew = dir_def//prefix_def//date//sep//time(1:6)//sep//time(8:10)//sep//SKC_"pid"//sep//getStr(pid_def)//ext_def
1095 : else
1096 133 : pathNew = dir_def//prefix_def//date//USC//time(1:6)//USC//time(8:10)//USC//SKC_"pid"//USC//getStr(pid_def)//ext_def
1097 : end if
1098 145 : inquire(file = pathNew, exist = exists)
1099 145 : if (.not. exists) return
1100 : end do
1101 :
1102 0 : if (present(failed)) then
1103 0 : failed = .true._LK
1104 0 : pathNew = SKC_""
1105 : else
1106 0 : error stop SK_"Failed to generate new file, even after "//getStr(COUNTER_MAX)//SK_" tries."
1107 : end if
1108 :
1109 725 : end procedure
1110 :
1111 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1112 :
1113 24 : module procedure getPathJoined
1114 : use pm_kind, only: SKC => SK
1115 : character(255, SK):: errmsg
1116 : logical(LK) :: failed
1117 24 : pathJoined = getPathJoined(p1, p2, failed, errmsg)
1118 : if (failed) error stop MODULE_NAME//SK_"@getPathJoined(): "//trim(errmsg) ! LCOV_EXCL_LINE
1119 24 : end procedure
1120 :
1121 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1122 :
1123 24 : module procedure getPathJoinedFailed
1124 :
1125 : use pm_kind, only: SKC => SK
1126 : use pm_sysShell, only: shell_type
1127 : character(*,SKC), parameter :: PSWA = DIR_SEP_WINDOWS_ALL
1128 : character(*,SKC), parameter :: PSPA = DIR_SEP_POSIX_ALL
1129 24 : type(shell_type) :: Shell
1130 : integer(IK) :: lenp1
1131 : integer(IK) :: lenp2
1132 :
1133 24 : lenp1 = len(p1, IK)
1134 24 : lenp2 = len(p2, IK)
1135 :
1136 24 : if (lenp1 == 0_IK .and. lenp2 == 0_IK) then
1137 4 : pathJoined = SKC_""
1138 4 : failed = .false._LK
1139 12 : return
1140 : end if
1141 :
1142 20 : if (present(errmsg)) then
1143 20 : shell = shell_type(failed, errmsg)
1144 : else
1145 0 : shell = shell_type(failed)
1146 : end if
1147 : if (failed) return ! LCOV_EXCL_LINE
1148 :
1149 20 : if (shell%is%windows) then
1150 0 : if (isPathAbsWindows(p2) .or. hasDriveLetter(p2)) then
1151 0 : pathJoined = p2
1152 0 : elseif (scan(PSWA, p1(lenp1:lenp1), kind = IK) == 0_IK) then
1153 0 : pathJoined = p1//shell%dirsep//p2
1154 : else
1155 0 : pathJoined = p1//p2
1156 : end if
1157 20 : elseif (shell%is%posix .or. shell%is%fish) then
1158 20 : if (isPathAbsPosix(p2)) then
1159 4 : pathJoined = p2
1160 16 : elseif (scan(PSPA, p1(lenp1:lenp1), kind = IK) == 0_IK) then
1161 12 : pathJoined = p1//shell%dirsep//p2
1162 : else
1163 4 : pathJoined = p1//p2
1164 : end if
1165 : end if
1166 :
1167 56 : end procedure
1168 :
1169 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1170 :
1171 62 : module procedure isFailedMakeDir
1172 : use pm_kind, only: SKC => SK
1173 :
1174 : character(:,SKC), allocatable :: command
1175 : type(shellis_type) :: shellis
1176 : integer(IK) :: itry
1177 : integer(IK) :: ntry_def
1178 : character(*,SKC), parameter :: LF = new_line(SKC_"a")
1179 :
1180 62 : if (present(errmsg)) then
1181 0 : shellis = shellis_type(failed, errmsg)
1182 : else
1183 62 : shellis = shellis_type(failed)
1184 : end if
1185 :
1186 : ! The order of the following conditionals is significant.
1187 :
1188 62 : if (shellis%powershell .and. shellis%windows) then
1189 : !> PowerShell accepts `-p` flag on both POSIX and Windows systems.
1190 : !> However, in POSIX OS, PowerShell requires `-p` for nested directories.
1191 : command = SKC_"New-Item -ItemType Directory -Path "//getPathVerbatimPowerShell(path)//SKC_" >null 2>&1" ! LCOV_EXCL_LINE
1192 62 : elseif (shellis%posix) then ! including microsoft powershell core.
1193 62 : command = SKC_"mkdir -p "//getPathVerbatimPosix(path)//SKC_" >/dev/null 2>&1" ! -p enables nested mkdir
1194 0 : elseif (shellis%fish) then
1195 0 : command = SKC_"mkdir -p "//getPathVerbatimFish(path)//SKC_" >/dev/null 2>&1" ! -p enables nested mkdir
1196 0 : elseif (shellis%cmd) then
1197 : command = SKC_"mkdir "//getPathVerbatimCMD(path)//SKC_" >nul 2>&1" ! LCOV_EXCL_LINE
1198 : else
1199 : !command = SKC_"mkdir "//path ! last shot in the dark. ! LCOV_EXCL_LINE
1200 : if (present(errmsg)) errmsg = MODULE_NAME//SK_"@isFailedMakeDir(): Failed to fetch the shell type."//LF//trim(errmsg) ! LCOV_EXCL_LINE
1201 : failed = .true._LK
1202 : return
1203 : end if
1204 : ! Create the folder.
1205 :
1206 62 : if (present(ntry)) then
1207 4 : CHECK_ASSERTION(__LINE__, ntry > 0_IK, SK_"@isFailedMakeDir(): The input `ntry` must be a positive number. ntry = "//getStr(ntry)) ! fpp
1208 : ntry_def = ntry
1209 : else
1210 : ntry_def = 1_IK
1211 : end if
1212 :
1213 62 : do itry = 1_IK, ntry_def
1214 186 : failed = isFailedExec(command, wait = wait, cmdmsg = errmsg)
1215 62 : failed = .not. isDir(path)
1216 62 : if (.not. failed) return
1217 : end do
1218 :
1219 : if (failed .and. present(errmsg)) errmsg = MODULE_NAME//SK_"@isFailedMakeDir(): Failed to create the requested directory."//LF//trim(errmsg) ! LCOV_EXCL_LINE
1220 : ! \warning do NOT remove. \bug gfortran with heap memory allocations fails to automatically deallocate on exit.
1221 0 : deallocate(command)
1222 :
1223 124 : end procedure
1224 :
1225 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1226 :
1227 4 : module procedure isFailedMakeDirTemp
1228 :
1229 : use pm_kind, only: SKC => SK
1230 : use pm_sysShell, only: isFailedGetDirTemp
1231 : character(*, SK), parameter :: PROCEDURE_NAME = MODULE_NAME//SK_"@isFailedMakeDirTemp()"
1232 : integer(IK) , parameter :: NTRY = 3_IK
1233 4 : character(:,SKC), allocatable :: parent_def
1234 : integer(IK) :: itry
1235 :
1236 4 : do itry = 1_IK, NTRY
1237 :
1238 4 : if (present(parent)) then
1239 0 : path = getPathNew(dir = parent, failed = failed)
1240 4 : elseif (.not. isFailedGetDirTemp(parent_def)) then
1241 4 : path = getPathNew(dir = parent_def, prefix = SK_"temp_", sep = SK_"_", failed = failed)
1242 : else
1243 0 : path = getPathNew(prefix = SK_"temp_", sep = SK_"_", failed = failed)
1244 : end if
1245 :
1246 4 : if (failed) then
1247 : if (present(errmsg)) errmsg = PROCEDURE_NAME//SK_"Failed to generate a unique dir name via getPathNew()." ! LCOV_EXCL_LINE
1248 : return ! LCOV_EXCL_LINE
1249 : end if
1250 :
1251 12 : if (.not. isFailedMakeDir(path, wait = .true._LK, ntry = NTRY, errmsg = errmsg)) return
1252 :
1253 : end do
1254 :
1255 0 : failed = .true._LK
1256 : if (present(errmsg)) errmsg = PROCEDURE_NAME//SK_": "//trim(errmsg) ! LCOV_EXCL_LINE
1257 :
1258 8 : end procedure
1259 :
1260 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1261 :
1262 : #define isFailedCopy_ENABLED 1
1263 :
1264 20 : module procedure isFailedCopy
1265 : use pm_kind, only: SKC => SK
1266 : #include "pm_sysPath@routines.inc.F90"
1267 40 : end procedure
1268 :
1269 : #undef isFailedCopy_ENABLED
1270 :
1271 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1272 :
1273 : #define isFailedMove_ENABLED 1
1274 :
1275 15 : module procedure isFailedMove
1276 : use pm_kind, only: SKC => SK
1277 : #include "pm_sysPath@routines.inc.F90"
1278 30 : end procedure
1279 :
1280 : #undef isFailedMove_ENABLED
1281 :
1282 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1283 :
1284 : #define isFailedRemove_ENABLED 1
1285 :
1286 74 : module procedure isFailedRemove
1287 : use pm_kind, only: SKC => SK
1288 : #include "pm_sysPath@routines.inc.F90"
1289 148 : end procedure
1290 :
1291 : #undef isFailedRemove_ENABLED
1292 :
1293 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1294 :
1295 37 : module procedure glob_BSSK
1296 : use pm_kind, only: SKC => SK
1297 : character(511, SK) :: errmsg
1298 37 : if (isFailedGlob(pattern, list, errmsg = errmsg)) error stop MODULE_NAME//SK_"@glob(): "//trim(errmsg)
1299 37 : end procedure
1300 :
1301 : #define isFailedGlob_ENABLED 1
1302 :
1303 : #define SK_ENABLED 1
1304 102 : module procedure isFailedGlob_SK
1305 : use pm_kind, only: SKC => SK
1306 : use pm_strASCII, only: setAsciiFromEscaped
1307 : use pm_sysShell, only: isFailedGetOutput, shell_type
1308 : #include "pm_sysPath@routines.inc.F90"
1309 : end procedure
1310 : #undef SK_ENABLED
1311 :
1312 : #define BSSK_ENABLED 1
1313 53 : module procedure isFailedGlob_BSSK
1314 : use pm_kind, only: SKC => SK
1315 : #include "pm_sysPath@routines.inc.F90"
1316 53 : end procedure
1317 : #undef BSSK_ENABLED
1318 :
1319 : #undef isFailedGlob_ENABLED
1320 :
1321 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1322 :
1323 28 : module procedure ls_BSSK
1324 : use pm_kind, only: SKC => SK
1325 : character(511, SK) :: errmsg
1326 84 : if (isFailedList(path, list, sort = sort, showdir = showdir, showfile = showfile, showhidden = showhidden, reversed = reversed, errmsg = errmsg)) error stop MODULE_NAME//SK_"@ls(): "//trim(errmsg)
1327 28 : end procedure
1328 :
1329 : #define isFailedList_ENABLED 1
1330 :
1331 : #define SK_ENABLED 1
1332 176 : module procedure isFailedList_SK
1333 : use pm_kind, only: SKC => SK
1334 : use pm_strASCII, only: setAsciiFromEscaped
1335 : use pm_sysShell, only: isFailedGetOutput, shell_type
1336 : #include "pm_sysPath@routines.inc.F90"
1337 536 : end procedure
1338 : #undef SK_ENABLED
1339 :
1340 : #define BSSK_ENABLED 1
1341 260 : module procedure isFailedList_BSSK
1342 : use pm_kind, only: SKC => SK
1343 : #include "pm_sysPath@routines.inc.F90"
1344 260 : end procedure
1345 : #undef BSSK_ENABLED
1346 :
1347 : #undef isFailedList_ENABLED
1348 :
1349 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1350 :
1351 : #define hasDriveLetter_ENABLED 1
1352 :
1353 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1354 :
1355 : #if SK5_ENABLED
1356 : module procedure hasDriveLetter_SK5
1357 : use pm_kind, only: SKC => SK5
1358 : #include "pm_sysPath@routines.inc.F90"
1359 : end procedure
1360 : #endif
1361 :
1362 : #if SK4_ENABLED
1363 : module procedure hasDriveLetter_SK4
1364 : use pm_kind, only: SKC => SK4
1365 : #include "pm_sysPath@routines.inc.F90"
1366 : end procedure
1367 : #endif
1368 :
1369 : #if SK3_ENABLED
1370 : module procedure hasDriveLetter_SK3
1371 : use pm_kind, only: SKC => SK3
1372 : #include "pm_sysPath@routines.inc.F90"
1373 : end procedure
1374 : #endif
1375 :
1376 : #if SK2_ENABLED
1377 : module procedure hasDriveLetter_SK2
1378 : use pm_kind, only: SKC => SK2
1379 : #include "pm_sysPath@routines.inc.F90"
1380 : end procedure
1381 : #endif
1382 :
1383 : #if SK1_ENABLED
1384 128 : module procedure hasDriveLetter_SK1
1385 : use pm_kind, only: SKC => SK1
1386 : #include "pm_sysPath@routines.inc.F90"
1387 128 : end procedure
1388 : #endif
1389 :
1390 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1391 :
1392 : #undef hasDriveLetter_ENABLED
1393 :
1394 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1395 :
1396 : #define isPathAbsPosix_ENABLED 1
1397 :
1398 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1399 :
1400 : #if SK5_ENABLED
1401 : module procedure isPathAbsPosix_SK5
1402 : use pm_kind, only: SKC => SK5
1403 : #include "pm_sysPath@routines.inc.F90"
1404 : end procedure
1405 : #endif
1406 :
1407 : #if SK4_ENABLED
1408 : module procedure isPathAbsPosix_SK4
1409 : use pm_kind, only: SKC => SK4
1410 : #include "pm_sysPath@routines.inc.F90"
1411 : end procedure
1412 : #endif
1413 :
1414 : #if SK3_ENABLED
1415 : module procedure isPathAbsPosix_SK3
1416 : use pm_kind, only: SKC => SK3
1417 : #include "pm_sysPath@routines.inc.F90"
1418 : end procedure
1419 : #endif
1420 :
1421 : #if SK2_ENABLED
1422 : module procedure isPathAbsPosix_SK2
1423 : use pm_kind, only: SKC => SK2
1424 : #include "pm_sysPath@routines.inc.F90"
1425 : end procedure
1426 : #endif
1427 :
1428 : #if SK1_ENABLED
1429 155 : module procedure isPathAbsPosix_SK1
1430 : use pm_kind, only: SKC => SK1
1431 : #include "pm_sysPath@routines.inc.F90"
1432 155 : end procedure
1433 : #endif
1434 :
1435 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1436 :
1437 : #undef isPathAbsPosix_ENABLED
1438 :
1439 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1440 :
1441 : #define isPathAbsWindows_ENABLED 1
1442 :
1443 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1444 :
1445 : #if SK5_ENABLED
1446 : module procedure isPathAbsWindows_SK5
1447 : use pm_kind, only: SKC => SK5
1448 : #include "pm_sysPath@routines.inc.F90"
1449 : end procedure
1450 : #endif
1451 :
1452 : #if SK4_ENABLED
1453 : module procedure isPathAbsWindows_SK4
1454 : use pm_kind, only: SKC => SK4
1455 : #include "pm_sysPath@routines.inc.F90"
1456 : end procedure
1457 : #endif
1458 :
1459 : #if SK3_ENABLED
1460 : module procedure isPathAbsWindows_SK3
1461 : use pm_kind, only: SKC => SK3
1462 : #include "pm_sysPath@routines.inc.F90"
1463 : end procedure
1464 : #endif
1465 :
1466 : #if SK2_ENABLED
1467 : module procedure isPathAbsWindows_SK2
1468 : use pm_kind, only: SKC => SK2
1469 : #include "pm_sysPath@routines.inc.F90"
1470 : end procedure
1471 : #endif
1472 :
1473 : #if SK1_ENABLED
1474 84 : module procedure isPathAbsWindows_SK1
1475 : use pm_kind, only: SKC => SK1
1476 : #include "pm_sysPath@routines.inc.F90"
1477 : end procedure
1478 : #endif
1479 :
1480 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1481 :
1482 : #undef isPathAbsWindows_ENABLED
1483 :
1484 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1485 :
1486 : #define getDirSep_ENABLED 1
1487 :
1488 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1489 :
1490 53 : module procedure getDirSep_SK
1491 : use pm_kind, only: SKC => SK
1492 : #include "pm_sysPath@routines.inc.F90"
1493 53 : end procedure
1494 :
1495 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1496 :
1497 : #if SK5_ENABLED
1498 : module procedure getDirSep_SK5
1499 : use pm_kind, only: SKC => SK5
1500 : #include "pm_sysPath@routines.inc.F90"
1501 : end procedure
1502 : #endif
1503 :
1504 : #if SK4_ENABLED
1505 : module procedure getDirSep_SK4
1506 : use pm_kind, only: SKC => SK4
1507 : #include "pm_sysPath@routines.inc.F90"
1508 : end procedure
1509 : #endif
1510 :
1511 : #if SK3_ENABLED
1512 : module procedure getDirSep_SK3
1513 : use pm_kind, only: SKC => SK3
1514 : #include "pm_sysPath@routines.inc.F90"
1515 : end procedure
1516 : #endif
1517 :
1518 : #if SK2_ENABLED
1519 : module procedure getDirSep_SK2
1520 : use pm_kind, only: SKC => SK2
1521 : #include "pm_sysPath@routines.inc.F90"
1522 : end procedure
1523 : #endif
1524 :
1525 : #if SK1_ENABLED
1526 4 : module procedure getDirSep_SK1
1527 : use pm_kind, only: SKC => SK1
1528 : #include "pm_sysPath@routines.inc.F90"
1529 4 : end procedure
1530 : #endif
1531 :
1532 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1533 :
1534 : #undef getDirSep_ENABLED
1535 :
1536 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1537 :
1538 : #define getDirSeps_ENABLED 1
1539 :
1540 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1541 :
1542 25 : module procedure getDirSeps_SK
1543 : use pm_kind, only: SKC => SK
1544 : #include "pm_sysPath@routines.inc.F90"
1545 25 : end procedure
1546 :
1547 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1548 :
1549 : #if SK5_ENABLED
1550 : module procedure getDirSeps_SK5
1551 : use pm_kind, only: SKC => SK5
1552 : #include "pm_sysPath@routines.inc.F90"
1553 : end procedure
1554 : #endif
1555 :
1556 : #if SK4_ENABLED
1557 : module procedure getDirSeps_SK4
1558 : use pm_kind, only: SKC => SK4
1559 : #include "pm_sysPath@routines.inc.F90"
1560 : end procedure
1561 : #endif
1562 :
1563 : #if SK3_ENABLED
1564 : module procedure getDirSeps_SK3
1565 : use pm_kind, only: SKC => SK3
1566 : #include "pm_sysPath@routines.inc.F90"
1567 : end procedure
1568 : #endif
1569 :
1570 : #if SK2_ENABLED
1571 : module procedure getDirSeps_SK2
1572 : use pm_kind, only: SKC => SK2
1573 : #include "pm_sysPath@routines.inc.F90"
1574 : end procedure
1575 : #endif
1576 :
1577 : #if SK1_ENABLED
1578 4 : module procedure getDirSeps_SK1
1579 : use pm_kind, only: SKC => SK1
1580 : #include "pm_sysPath@routines.inc.F90"
1581 4 : end procedure
1582 : #endif
1583 :
1584 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1585 :
1586 : #undef getDirSeps_ENABLED
1587 :
1588 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1589 :
1590 : #define getPathSep_ENABLED 1
1591 :
1592 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1593 :
1594 88 : module procedure getPathSep_SK
1595 : use pm_kind, only: SKC => SK
1596 : #include "pm_sysPath@routines.inc.F90"
1597 88 : end procedure
1598 :
1599 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1600 :
1601 : #if SK5_ENABLED
1602 : module procedure getPathSep_SK5
1603 : use pm_kind, only: SKC => SK5
1604 : #include "pm_sysPath@routines.inc.F90"
1605 : end procedure
1606 : #endif
1607 :
1608 : #if SK4_ENABLED
1609 : module procedure getPathSep_SK4
1610 : use pm_kind, only: SKC => SK4
1611 : #include "pm_sysPath@routines.inc.F90"
1612 : end procedure
1613 : #endif
1614 :
1615 : #if SK3_ENABLED
1616 : module procedure getPathSep_SK3
1617 : use pm_kind, only: SKC => SK3
1618 : #include "pm_sysPath@routines.inc.F90"
1619 : end procedure
1620 : #endif
1621 :
1622 : #if SK2_ENABLED
1623 : module procedure getPathSep_SK2
1624 : use pm_kind, only: SKC => SK2
1625 : #include "pm_sysPath@routines.inc.F90"
1626 : end procedure
1627 : #endif
1628 :
1629 : #if SK1_ENABLED
1630 4 : module procedure getPathSep_SK1
1631 : use pm_kind, only: SKC => SK1
1632 : #include "pm_sysPath@routines.inc.F90"
1633 4 : end procedure
1634 : #endif
1635 :
1636 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1637 :
1638 : #undef getPathSep_ENABLED
1639 :
1640 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1641 :
1642 : #define getPathVerbatimCMD_ENABLED 1
1643 :
1644 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1645 :
1646 : #if SK5_ENABLED
1647 : module procedure getPathVerbatimCMD_SK5
1648 : use pm_kind, only: SKC => SK5
1649 : #include "pm_sysPath@routines.inc.F90"
1650 : end procedure
1651 : #endif
1652 :
1653 : #if SK4_ENABLED
1654 : module procedure getPathVerbatimCMD_SK4
1655 : use pm_kind, only: SKC => SK4
1656 : #include "pm_sysPath@routines.inc.F90"
1657 : end procedure
1658 : #endif
1659 :
1660 : #if SK3_ENABLED
1661 : module procedure getPathVerbatimCMD_SK3
1662 : use pm_kind, only: SKC => SK3
1663 : #include "pm_sysPath@routines.inc.F90"
1664 : end procedure
1665 : #endif
1666 :
1667 : #if SK2_ENABLED
1668 : module procedure getPathVerbatimCMD_SK2
1669 : use pm_kind, only: SKC => SK2
1670 : #include "pm_sysPath@routines.inc.F90"
1671 : end procedure
1672 : #endif
1673 :
1674 : #if SK1_ENABLED
1675 12 : module procedure getPathVerbatimCMD_SK1
1676 : use pm_kind, only: SKC => SK1
1677 : #include "pm_sysPath@routines.inc.F90"
1678 12 : end procedure
1679 : #endif
1680 :
1681 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1682 :
1683 : #undef getPathVerbatimCMD_ENABLED
1684 :
1685 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1686 :
1687 : #define getPathVerbatimPowerShell_ENABLED 1
1688 :
1689 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1690 :
1691 : #if SK5_ENABLED
1692 : module procedure getPathVerbatimPowerShell_SK5
1693 : use pm_kind, only: SKC => SK5
1694 : #include "pm_sysPath@routines.inc.F90"
1695 : end procedure
1696 : #endif
1697 :
1698 : #if SK4_ENABLED
1699 : module procedure getPathVerbatimPowerShell_SK4
1700 : use pm_kind, only: SKC => SK4
1701 : #include "pm_sysPath@routines.inc.F90"
1702 : end procedure
1703 : #endif
1704 :
1705 : #if SK3_ENABLED
1706 : module procedure getPathVerbatimPowerShell_SK3
1707 : use pm_kind, only: SKC => SK3
1708 : #include "pm_sysPath@routines.inc.F90"
1709 : end procedure
1710 : #endif
1711 :
1712 : #if SK2_ENABLED
1713 : module procedure getPathVerbatimPowerShell_SK2
1714 : use pm_kind, only: SKC => SK2
1715 : #include "pm_sysPath@routines.inc.F90"
1716 : end procedure
1717 : #endif
1718 :
1719 : #if SK1_ENABLED
1720 12 : module procedure getPathVerbatimPowerShell_SK1
1721 : use pm_kind, only: SKC => SK1
1722 : #include "pm_sysPath@routines.inc.F90"
1723 12 : end procedure
1724 : #endif
1725 :
1726 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1727 :
1728 : #undef getPathVerbatimPowerShell_ENABLED
1729 :
1730 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1731 :
1732 : #define getPathVerbatimPosix_ENABLED 1
1733 :
1734 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1735 :
1736 : #if SK5_ENABLED
1737 : module procedure getPathVerbatimPosix_SK5
1738 : use pm_kind, only: SKC => SK5
1739 : #include "pm_sysPath@routines.inc.F90"
1740 : end procedure
1741 : #endif
1742 :
1743 : #if SK4_ENABLED
1744 : module procedure getPathVerbatimPosix_SK4
1745 : use pm_kind, only: SKC => SK4
1746 : #include "pm_sysPath@routines.inc.F90"
1747 : end procedure
1748 : #endif
1749 :
1750 : #if SK3_ENABLED
1751 : module procedure getPathVerbatimPosix_SK3
1752 : use pm_kind, only: SKC => SK3
1753 : #include "pm_sysPath@routines.inc.F90"
1754 : end procedure
1755 : #endif
1756 :
1757 : #if SK2_ENABLED
1758 : module procedure getPathVerbatimPosix_SK2
1759 : use pm_kind, only: SKC => SK2
1760 : #include "pm_sysPath@routines.inc.F90"
1761 : end procedure
1762 : #endif
1763 :
1764 : #if SK1_ENABLED
1765 638 : module procedure getPathVerbatimPosix_SK1
1766 : use pm_kind, only: SKC => SK1
1767 : #include "pm_sysPath@routines.inc.F90"
1768 638 : end procedure
1769 : #endif
1770 :
1771 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1772 :
1773 : #undef getPathVerbatimPosix_ENABLED
1774 :
1775 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1776 :
1777 : #define getPathVerbatimFish_ENABLED 1
1778 :
1779 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1780 :
1781 : #if SK5_ENABLED
1782 : module procedure getPathVerbatimFish_SK5
1783 : use pm_kind, only: SKC => SK5
1784 : #include "pm_sysPath@routines.inc.F90"
1785 : end procedure
1786 : #endif
1787 :
1788 : #if SK4_ENABLED
1789 : module procedure getPathVerbatimFish_SK4
1790 : use pm_kind, only: SKC => SK4
1791 : #include "pm_sysPath@routines.inc.F90"
1792 : end procedure
1793 : #endif
1794 :
1795 : #if SK3_ENABLED
1796 : module procedure getPathVerbatimFish_SK3
1797 : use pm_kind, only: SKC => SK3
1798 : #include "pm_sysPath@routines.inc.F90"
1799 : end procedure
1800 : #endif
1801 :
1802 : #if SK2_ENABLED
1803 : module procedure getPathVerbatimFish_SK2
1804 : use pm_kind, only: SKC => SK2
1805 : #include "pm_sysPath@routines.inc.F90"
1806 : end procedure
1807 : #endif
1808 :
1809 : #if SK1_ENABLED
1810 20 : module procedure getPathVerbatimFish_SK1
1811 : use pm_kind, only: SKC => SK1
1812 : #include "pm_sysPath@routines.inc.F90"
1813 20 : end procedure
1814 : #endif
1815 :
1816 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1817 :
1818 : #undef getPathVerbatimFish_ENABLED
1819 :
1820 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1821 :
1822 : #define getPathPosix_ENABLED 1
1823 :
1824 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1825 :
1826 : #define getPathPosix_D0_SK_ENABLED 1
1827 :
1828 : #if SK5_ENABLED
1829 : module procedure getPathPosix_D0_SK5
1830 : use pm_kind, only: SKC => SK5
1831 : #include "pm_sysPath@routines.inc.F90"
1832 : end procedure
1833 : #endif
1834 :
1835 : #if SK4_ENABLED
1836 : module procedure getPathPosix_D0_SK4
1837 : use pm_kind, only: SKC => SK4
1838 : #include "pm_sysPath@routines.inc.F90"
1839 : end procedure
1840 : #endif
1841 :
1842 : #if SK3_ENABLED
1843 : module procedure getPathPosix_D0_SK3
1844 : use pm_kind, only: SKC => SK3
1845 : #include "pm_sysPath@routines.inc.F90"
1846 : end procedure
1847 : #endif
1848 :
1849 : #if SK2_ENABLED
1850 : module procedure getPathPosix_D0_SK2
1851 : use pm_kind, only: SKC => SK2
1852 : #include "pm_sysPath@routines.inc.F90"
1853 : end procedure
1854 : #endif
1855 :
1856 : #if SK1_ENABLED
1857 28 : module procedure getPathPosix_D0_SK1
1858 : use pm_kind, only: SKC => SK1
1859 : #include "pm_sysPath@routines.inc.F90"
1860 28 : end procedure
1861 : #endif
1862 :
1863 : #undef getPathPosix_D0_SK_ENABLED
1864 :
1865 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1866 :
1867 : #undef getPathPosix_ENABLED
1868 :
1869 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1870 :
1871 : #define setPathPosix_ENABLED 1
1872 :
1873 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1874 :
1875 : #define setPathPosix_D0_SK_ENABLED 1
1876 :
1877 : #if SK5_ENABLED
1878 : module procedure setPathPosix_D0_SK5
1879 : use pm_kind, only: SKC => SK5
1880 : #include "pm_sysPath@routines.inc.F90"
1881 : end procedure
1882 : #endif
1883 :
1884 : #if SK4_ENABLED
1885 : module procedure setPathPosix_D0_SK4
1886 : use pm_kind, only: SKC => SK4
1887 : #include "pm_sysPath@routines.inc.F90"
1888 : end procedure
1889 : #endif
1890 :
1891 : #if SK3_ENABLED
1892 : module procedure setPathPosix_D0_SK3
1893 : use pm_kind, only: SKC => SK3
1894 : #include "pm_sysPath@routines.inc.F90"
1895 : end procedure
1896 : #endif
1897 :
1898 : #if SK2_ENABLED
1899 : module procedure setPathPosix_D0_SK2
1900 : use pm_kind, only: SKC => SK2
1901 : #include "pm_sysPath@routines.inc.F90"
1902 : end procedure
1903 : #endif
1904 :
1905 : #if SK1_ENABLED
1906 104 : module procedure setPathPosix_D0_SK1
1907 : use pm_kind, only: SKC => SK1
1908 : #include "pm_sysPath@routines.inc.F90"
1909 56 : end procedure
1910 : #endif
1911 :
1912 : #undef setPathPosix_D0_SK_ENABLED
1913 :
1914 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1915 :
1916 : #undef setPathPosix_ENABLED
1917 :
1918 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1919 :
1920 : #define getPathPosixEscaped_ENABLED 1
1921 :
1922 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1923 :
1924 : #define getPathPosixEscaped_D0_SK_ENABLED 1
1925 :
1926 : #if SK5_ENABLED
1927 : module procedure getPathPosixEscaped_D0_SK5
1928 : use pm_kind, only: SKC => SK5
1929 : #include "pm_sysPath@routines.inc.F90"
1930 : end procedure
1931 : #endif
1932 :
1933 : #if SK4_ENABLED
1934 : module procedure getPathPosixEscaped_D0_SK4
1935 : use pm_kind, only: SKC => SK4
1936 : #include "pm_sysPath@routines.inc.F90"
1937 : end procedure
1938 : #endif
1939 :
1940 : #if SK3_ENABLED
1941 : module procedure getPathPosixEscaped_D0_SK3
1942 : use pm_kind, only: SKC => SK3
1943 : #include "pm_sysPath@routines.inc.F90"
1944 : end procedure
1945 : #endif
1946 :
1947 : #if SK2_ENABLED
1948 : module procedure getPathPosixEscaped_D0_SK2
1949 : use pm_kind, only: SKC => SK2
1950 : #include "pm_sysPath@routines.inc.F90"
1951 : end procedure
1952 : #endif
1953 :
1954 : #if SK1_ENABLED
1955 28 : module procedure getPathPosixEscaped_D0_SK1
1956 : use pm_kind, only: SKC => SK1
1957 : #include "pm_sysPath@routines.inc.F90"
1958 28 : end procedure
1959 : #endif
1960 :
1961 : #undef getPathPosixEscaped_D0_SK_ENABLED
1962 :
1963 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1964 :
1965 : #undef getPathPosixEscaped_ENABLED
1966 :
1967 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1968 :
1969 : #define setPathPosixEscaped_ENABLED 1
1970 :
1971 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1972 :
1973 : #define setPathPosixEscaped_D0_SK_ENABLED 1
1974 :
1975 : #if SK5_ENABLED
1976 : module procedure setPathPosixEscaped_D0_SK5
1977 : use pm_kind, only: SKC => SK5
1978 : #include "pm_sysPath@routines.inc.F90"
1979 : end procedure
1980 : #endif
1981 :
1982 : #if SK4_ENABLED
1983 : module procedure setPathPosixEscaped_D0_SK4
1984 : use pm_kind, only: SKC => SK4
1985 : #include "pm_sysPath@routines.inc.F90"
1986 : end procedure
1987 : #endif
1988 :
1989 : #if SK3_ENABLED
1990 : module procedure setPathPosixEscaped_D0_SK3
1991 : use pm_kind, only: SKC => SK3
1992 : #include "pm_sysPath@routines.inc.F90"
1993 : end procedure
1994 : #endif
1995 :
1996 : #if SK2_ENABLED
1997 : module procedure setPathPosixEscaped_D0_SK2
1998 : use pm_kind, only: SKC => SK2
1999 : #include "pm_sysPath@routines.inc.F90"
2000 : end procedure
2001 : #endif
2002 :
2003 : #if SK1_ENABLED
2004 0 : module procedure setPathPosixEscaped_D0_SK1
2005 : use pm_kind, only: SKC => SK1
2006 : #include "pm_sysPath@routines.inc.F90"
2007 56 : end procedure
2008 : #endif
2009 :
2010 : #undef setPathPosixEscaped_D0_SK_ENABLED
2011 :
2012 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2013 :
2014 : #undef setPathPosixEscaped_ENABLED
2015 :
2016 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2017 :
2018 : #define getPathWindows_ENABLED 1
2019 :
2020 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2021 :
2022 : #define getPathWindows_D0_SK_ENABLED 1
2023 :
2024 : #if SK5_ENABLED
2025 : module procedure getPathWindows_D0_SK5
2026 : use pm_kind, only: SKC => SK5
2027 : #include "pm_sysPath@routines.inc.F90"
2028 : end procedure
2029 : #endif
2030 :
2031 : #if SK4_ENABLED
2032 : module procedure getPathWindows_D0_SK4
2033 : use pm_kind, only: SKC => SK4
2034 : #include "pm_sysPath@routines.inc.F90"
2035 : end procedure
2036 : #endif
2037 :
2038 : #if SK3_ENABLED
2039 : module procedure getPathWindows_D0_SK3
2040 : use pm_kind, only: SKC => SK3
2041 : #include "pm_sysPath@routines.inc.F90"
2042 : end procedure
2043 : #endif
2044 :
2045 : #if SK2_ENABLED
2046 : module procedure getPathWindows_D0_SK2
2047 : use pm_kind, only: SKC => SK2
2048 : #include "pm_sysPath@routines.inc.F90"
2049 : end procedure
2050 : #endif
2051 :
2052 : #if SK1_ENABLED
2053 80 : module procedure getPathWindows_D0_SK1
2054 : use pm_kind, only: SKC => SK1
2055 : #include "pm_sysPath@routines.inc.F90"
2056 80 : end procedure
2057 : #endif
2058 :
2059 : #undef getPathWindows_D0_SK_ENABLED
2060 :
2061 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2062 :
2063 : #undef getPathWindows_ENABLED
2064 :
2065 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2066 :
2067 : #define setPathWindows_ENABLED 1
2068 :
2069 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2070 :
2071 : #define setPathWindows_D0_SK_ENABLED 1
2072 :
2073 : #if SK5_ENABLED
2074 : module procedure setPathWindows_D0_SK5
2075 : use pm_kind, only: SKC => SK5
2076 : #include "pm_sysPath@routines.inc.F90"
2077 : end procedure
2078 : #endif
2079 :
2080 : #if SK4_ENABLED
2081 : module procedure setPathWindows_D0_SK4
2082 : use pm_kind, only: SKC => SK4
2083 : #include "pm_sysPath@routines.inc.F90"
2084 : end procedure
2085 : #endif
2086 :
2087 : #if SK3_ENABLED
2088 : module procedure setPathWindows_D0_SK3
2089 : use pm_kind, only: SKC => SK3
2090 : #include "pm_sysPath@routines.inc.F90"
2091 : end procedure
2092 : #endif
2093 :
2094 : #if SK2_ENABLED
2095 : module procedure setPathWindows_D0_SK2
2096 : use pm_kind, only: SKC => SK2
2097 : #include "pm_sysPath@routines.inc.F90"
2098 : end procedure
2099 : #endif
2100 :
2101 : #if SK1_ENABLED
2102 376 : module procedure setPathWindows_D0_SK1
2103 : use pm_kind, only: SKC => SK1
2104 : #include "pm_sysPath@routines.inc.F90"
2105 192 : end procedure
2106 : #endif
2107 :
2108 : #undef setPathWindows_D0_SK_ENABLED
2109 :
2110 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2111 :
2112 : #undef setPathWindows_ENABLED
2113 :
2114 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2115 :
2116 : #define getPathHostNameIndex_ENABLED 1
2117 :
2118 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2119 :
2120 : #if SK5_ENABLED
2121 : module procedure getPathHostNameIndex_SK5
2122 : use pm_kind, only: SKC => SK5
2123 : #include "pm_sysPath@routines.inc.F90"
2124 : end procedure
2125 : #endif
2126 :
2127 : #if SK4_ENABLED
2128 : module procedure getPathHostNameIndex_SK4
2129 : use pm_kind, only: SKC => SK4
2130 : #include "pm_sysPath@routines.inc.F90"
2131 : end procedure
2132 : #endif
2133 :
2134 : #if SK3_ENABLED
2135 : module procedure getPathHostNameIndex_SK3
2136 : use pm_kind, only: SKC => SK3
2137 : #include "pm_sysPath@routines.inc.F90"
2138 : end procedure
2139 : #endif
2140 :
2141 : #if SK2_ENABLED
2142 : module procedure getPathHostNameIndex_SK2
2143 : use pm_kind, only: SKC => SK2
2144 : #include "pm_sysPath@routines.inc.F90"
2145 : end procedure
2146 : #endif
2147 :
2148 : #if SK1_ENABLED
2149 344 : module procedure getPathHostNameIndex_SK1
2150 : use pm_kind, only: SKC => SK1
2151 : #include "pm_sysPath@routines.inc.F90"
2152 : end procedure
2153 : #endif
2154 :
2155 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2156 :
2157 : #undef getPathHostNameIndex_ENABLED
2158 :
2159 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2160 : !
2161 : !#define getPathNew_ENABLED 1
2162 : !
2163 : ! !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2164 : !
2165 : !#define getPathNew_D0_SK_ENABLED 1
2166 : !
2167 : !#if SK5_ENABLED
2168 : ! module procedure getPathNew_D0_SK5
2169 : ! use pm_kind, only: SKC => SK5
2170 : !#include "pm_sysPath@routines.inc.F90"
2171 : ! end procedure
2172 : !#endif
2173 : !
2174 : !#if SK4_ENABLED
2175 : ! module procedure getPathNew_D0_SK4
2176 : ! use pm_kind, only: SKC => SK4
2177 : !#include "pm_sysPath@routines.inc.F90"
2178 : ! end procedure
2179 : !#endif
2180 : !
2181 : !#if SK3_ENABLED
2182 : ! module procedure getPathNew_D0_SK3
2183 : ! use pm_kind, only: SKC => SK3
2184 : !#include "pm_sysPath@routines.inc.F90"
2185 : ! end procedure
2186 : !#endif
2187 : !
2188 : !#if SK2_ENABLED
2189 : ! module procedure getPathNew_D0_SK2
2190 : ! use pm_kind, only: SKC => SK2
2191 : !#include "pm_sysPath@routines.inc.F90"
2192 : ! end procedure
2193 : !#endif
2194 : !
2195 : !#if SK1_ENABLED
2196 : ! module procedure getPathNew_D0_SK1
2197 : ! use pm_kind, only: SKC => SK1
2198 : !#include "pm_sysPath@routines.inc.F90"
2199 : ! end procedure
2200 : !#endif
2201 : !
2202 : !#undef getPathNew_D0_SK_ENABLED
2203 : !
2204 : ! !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2205 : !
2206 : !#undef getPathNew_ENABLED
2207 : !
2208 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2209 : !
2210 : !#define isDir_ENABLED 1
2211 : !
2212 : ! !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2213 : !
2214 : !#define isDir_D0_SK_ENABLED 1
2215 : !
2216 : !#if SK5_ENABLED
2217 : ! module procedure isDir_D0_SK5
2218 : ! use pm_kind, only: SKC => SK5
2219 : !#include "pm_sysPath@routines.inc.F90"
2220 : ! end procedure
2221 : !#endif
2222 : !
2223 : !#if SK4_ENABLED
2224 : ! module procedure isDir_D0_SK4
2225 : ! use pm_kind, only: SKC => SK4
2226 : !#include "pm_sysPath@routines.inc.F90"
2227 : ! end procedure
2228 : !#endif
2229 : !
2230 : !#if SK3_ENABLED
2231 : ! module procedure isDir_D0_SK3
2232 : ! use pm_kind, only: SKC => SK3
2233 : !#include "pm_sysPath@routines.inc.F90"
2234 : ! end procedure
2235 : !#endif
2236 : !
2237 : !#if SK2_ENABLED
2238 : ! module procedure isDir_D0_SK2
2239 : ! use pm_kind, only: SKC => SK2
2240 : !#include "pm_sysPath@routines.inc.F90"
2241 : ! end procedure
2242 : !#endif
2243 : !
2244 : !#if SK1_ENABLED
2245 : ! module procedure isDir_D0_SK1
2246 : ! use pm_kind, only: SKC => SK1
2247 : !#include "pm_sysPath@routines.inc.F90"
2248 : ! end procedure
2249 : !#endif
2250 : !
2251 : !#undef isDir_D0_SK_ENABLED
2252 : !
2253 : ! !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2254 : !
2255 : !#undef isDir_ENABLED
2256 : !
2257 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2258 : !
2259 : !#define isFile_ENABLED 1
2260 : !
2261 : ! !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2262 : !
2263 : !#define isFile_D0_SK_ENABLED 1
2264 : !
2265 : !#if SK5_ENABLED
2266 : ! module procedure isFile_D0_SK5
2267 : ! use pm_kind, only: SKC => SK5
2268 : !#include "pm_sysPath@routines.inc.F90"
2269 : ! end procedure
2270 : !#endif
2271 : !
2272 : !#if SK4_ENABLED
2273 : ! module procedure isFile_D0_SK4
2274 : ! use pm_kind, only: SKC => SK4
2275 : !#include "pm_sysPath@routines.inc.F90"
2276 : ! end procedure
2277 : !#endif
2278 : !
2279 : !#if SK3_ENABLED
2280 : ! module procedure isFile_D0_SK3
2281 : ! use pm_kind, only: SKC => SK3
2282 : !#include "pm_sysPath@routines.inc.F90"
2283 : ! end procedure
2284 : !#endif
2285 : !
2286 : !#if SK2_ENABLED
2287 : ! module procedure isFile_D0_SK2
2288 : ! use pm_kind, only: SKC => SK2
2289 : !#include "pm_sysPath@routines.inc.F90"
2290 : ! end procedure
2291 : !#endif
2292 : !
2293 : !#if SK1_ENABLED
2294 : ! module procedure isFile_D0_SK1
2295 : ! use pm_kind, only: SKC => SK1
2296 : !#include "pm_sysPath@routines.inc.F90"
2297 : ! end procedure
2298 : !#endif
2299 : !
2300 : !#undef isFile_D0_SK_ENABLED
2301 : !
2302 : ! !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2303 : !
2304 : !#undef isFile_ENABLED
2305 : !
2306 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2307 : !
2308 : !#define mkdir_ENABLED 1
2309 : !
2310 : ! !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2311 : !
2312 : !#define mkdir_D0_SK_ENABLED 1
2313 : !
2314 : !#if SK5_ENABLED
2315 : ! module procedure mkdir_D0_SK5
2316 : ! use pm_kind, only: SKC => SK5
2317 : !#include "pm_sysPath@routines.inc.F90"
2318 : ! end procedure
2319 : !#endif
2320 : !
2321 : !#if SK4_ENABLED
2322 : ! module procedure mkdir_D0_SK4
2323 : ! use pm_kind, only: SKC => SK4
2324 : !#include "pm_sysPath@routines.inc.F90"
2325 : ! end procedure
2326 : !#endif
2327 : !
2328 : !#if SK3_ENABLED
2329 : ! module procedure mkdir_D0_SK3
2330 : ! use pm_kind, only: SKC => SK3
2331 : !#include "pm_sysPath@routines.inc.F90"
2332 : ! end procedure
2333 : !#endif
2334 : !
2335 : !#if SK2_ENABLED
2336 : ! module procedure mkdir_D0_SK2
2337 : ! use pm_kind, only: SKC => SK2
2338 : !#include "pm_sysPath@routines.inc.F90"
2339 : ! end procedure
2340 : !#endif
2341 : !
2342 : !#if SK1_ENABLED
2343 : ! module procedure mkdir_D0_SK1
2344 : ! use pm_kind, only: SKC => SK1
2345 : !#include "pm_sysPath@routines.inc.F90"
2346 : ! end procedure
2347 : !#endif
2348 : !
2349 : !#undef mkdir_D0_SK_ENABLED
2350 : !
2351 : ! !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2352 : !
2353 : !#undef mkdir_ENABLED
2354 : !
2355 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2356 :
2357 : end submodule routines
2358 :
2359 : #undef UNESCAPE_REINDEX_LIST
2360 : #undef CHECK_ASSERTION
2361 : #undef ERROR_STOP_IF
|