c_mkdir Interface

interface

Atomically rename/replace oldpath to newpath (same filesystem). Returns 0 on success, nonzero on failure. Unlink a file or remove an empty directory. Returns 0 on success, nonzero on failure. Create one directory (mode 0777 & umask on POSIX). Returns 0 on success, nonzero on failure (including "already exists"). Test whether path exists (access(F_OK) / _access). Depth-first removal of path and everything under it. Returns 0 if the tree was removed or the path did not exist; nonzero if a remove failed partway. Flush a file's data to stable storage (fsync / _commit). flush the owning Fortran unit first so the runtime buffer has reached the OS before this call drives the OS cache to disk. Returns 0 on success, nonzero on failure. Flush a directory's entries to stable storage, making a file creation/deletion within it durable. A no-op on Windows (NTFS journals directory metadata). Returns 0 on success. Set a file's length to length bytes, shrinking or growing it (truncate / _chsize_s). Returns 0 on success, nonzero on failure. Try (non-blocking) to take an advisory lock on path, which is created if absent. exclusive selects a write lock; otherwise a shared (read) lock that coexists with other shared holders. On success ierr is 0 and tok holds the lock (an opaque token — a POSIX fd or a Win32 HANDLE — pass it to c_lock_release). On contention ierr is 1 and tok is -1; on a genuine open/create failure ierr is 2. The lock lives only as long as tok is held, and is dropped automatically if the process dies. Release a lock taken by c_lock_try and close its descriptor or handle. A no-op for an unheld (-1) token; resets tok to -1. Downgrade an exclusive lock to shared so other read-only connections may attach. Returns 0 on success, nonzero on failure. .true. when standard input (fd 0) is a terminal, so an interactive prompt is appropriate. Wraps POSIX isatty / CRT _isatty.


public module function c_mkdir(path) result(ierr)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: path

Directory to create

Return Value integer

0 on success, nonzero on failure