https://github.com/urbanjost/m_path
OOP interface to other GPF modules to manipulate and access files for use as a dependency with fpm (Fortran Package Manager)
https://github.com/urbanjost/m_path
filenames fortran-package-manager fpm pathnames
Last synced: 3 months ago
JSON representation
OOP interface to other GPF modules to manipulate and access files for use as a dependency with fpm (Fortran Package Manager)
- Host: GitHub
- URL: https://github.com/urbanjost/m_path
- Owner: urbanjost
- License: unlicense
- Created: 2020-11-08T00:59:52.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-03-29T08:16:11.000Z (about 2 years ago)
- Last Synced: 2024-12-30T18:28:16.650Z (over 1 year ago)
- Topics: filenames, fortran-package-manager, fpm, pathnames
- Language: Fortran
- Homepage:
- Size: 1.08 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# M_path
## Fortran OOP interface for a POSIX pathname
The M_path(3f) module creates an OOP (Object Oriented Programming)
interface to other modules in the
[GPF ](https://github.com/urbanjost?tab=repositories)
(General Purpose Fortran) package which can be built using
```bash
git clone https://github.com/urbanjost/general-purpose-fortran
cd general-purpose-fortran
make
```
It allows the typical components of a pathname on a POSIX system
(Such as GNU/Linux, Unix and Cygwin) to be accessed easily, to
render the full pathname of the path and to get basic file properties
(permissions, size, ownership, ...). The type defined is
```fortran
type path
! COMPONENTS:
character(len=:),allocatable :: name
contains
! METHODS:
procedure :: branch
procedure :: leaf
procedure :: stem
procedure :: bud
procedure :: init
procedure :: is_dir
procedure :: stat
procedure :: readable
procedure :: writable
procedure :: executable
procedure :: exists
procedure :: realpath
! OVERLOADED OPERATORS FOR TYPE(path)
procedure,private :: eq
generic :: operator(==) => eq
end type path
```
---
It requires other modules from the package (_Note that you can get and build
the GPF package with just a Fortran compiler and make(1)_). This
repository is intended for allowing access to the module and its
dependencies via `fpm` (Fortran Package Manager).
---

---
## Documentation
The [man-page](https://urbanjost.github.io/M_path/index.html)
## Download
To download the github repository and build it with `fpm` ( as
described at
[Fortran Package Manager](https://github.com/fortran-lang/fpm) )
use
```bash
git clone https://github.com/urbanjost/M_path.git
cd M_path
fpm test
fpm run -- .
```
but to use this as intended as a dependency in your fpm.toml project
file just add the following into your `fpm` manifest file:
```toml
[dependencies]
M_path = { git = "https://github.com/urbanjost/M_path.git" }
```