{"id":18076268,"url":"https://github.com/scivision/ffilesystem-concepts","last_synced_at":"2025-04-05T19:43:01.616Z","repository":{"id":194008686,"uuid":"616091390","full_name":"scivision/ffilesystem-concepts","owner":"scivision","description":"A testbed for our Ffilesystem library, to test techniques across platforms first.","archived":false,"fork":false,"pushed_at":"2024-12-12T20:11:54.000Z","size":198,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-11T17:59:44.238Z","etag":null,"topics":["cpp17","path-manipulation"],"latest_commit_sha":null,"homepage":"https://github.com/scivision/fortran-filesystem","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scivision.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-19T15:33:14.000Z","updated_at":"2024-12-12T20:11:59.000Z","dependencies_parsed_at":"2025-01-23T02:00:21.307Z","dependency_job_id":"357a9725-70ce-4648-af44-3849d9df0a7d","html_url":"https://github.com/scivision/ffilesystem-concepts","commit_stats":null,"previous_names":["scivision/ffilesystem-concepts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scivision%2Fffilesystem-concepts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scivision%2Fffilesystem-concepts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scivision%2Fffilesystem-concepts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scivision%2Fffilesystem-concepts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scivision","download_url":"https://codeload.github.com/scivision/ffilesystem-concepts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247393538,"owners_count":20931809,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp17","path-manipulation"],"created_at":"2024-10-31T11:09:26.183Z","updated_at":"2025-04-05T19:43:01.596Z","avatar_url":"https://github.com/scivision.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Filesystem concepts\n\nA testbed for the\n[Ffilesystem library](https://github.com/scivision/fortran-filesystem),\nto test across platforms without breaking the widely-used library.\nAs in Ffilesystem, we use some optional C++20 features.\nThe main focus is on the C++17\n[filesystem](https://en.cppreference.com/w/cpp/filesystem)\nstandard library.\nWe also demonstrate techniques in C to reproduce some C++ filesystem functionality at lower fidelity--otherwise, we'd be reinventing the wheel.\n\n## platform-independent mkdtemp()\n\nPlatform-independent\n[mkdtemp()](./test/mkdtemp/)\nis a C++17 example of creating a temporary directory that works on Windows, Linux, macOS, MinGW, Cygwin, WSL, etc. across compilers and operating systems.\n\n## Canonical\n\nCreating [canonical](./test/canonical/) \"lower_name\" as entirely the lower case version of \"cased_name\" deliberately forces the drive/root to be lower case.\nIn general full paths on Windows and macOS have some uppercase character elements:\n\n* Windows: upper case drive letter\n* macOS: /Users/ etc. has some upper case letters\n\n## Copy file tree\n\nRecursively [copy a file tree](./test/copytree/).\n\n## Iterate over directory\n\n[Example](./test/iterdir/) of iterating over directory contents.\n\n## Is executable\n\n[Is executable](./test/is_exe/) tests if a file is executable. On Windows filesystems such as NTFS, all files are always seen as executable.\nOn most other filesystems, executable permissions can be detected.\n\n## file types\n\nShow what [type a file](./test/file_types/) is, such as regular file, directory, symlink, etc.\n\n## lib_dir\n\nA working example of how to determine an executable's full path no matter what the current working directory is.\nThis can be useful when a data file is known to exist relative to an executable.\nThis is relevant to say CMake installed project that has an executable and associated data files installed.\nAssuming the user knows the path to the MAIN executable in the installed directory, the program can determine its own full path and\nthen a priori know the relative path to the data file(s).\n\n## Drive space available\n\nDetermine the [free space available on a drive](./test/space_avail/).\n\n## Filesystem type\n\nDetermine the\n[filesystem type](./test/filesystem_type/)\nof a drive or partition.\nNote that WSL uses\n[v9fs](https://devblogs.microsoft.com/commandline/whats-new-for-wsl-in-windows-10-version-1903/).\n\n## Windows short path\n\nFor Windows only, find the short path (8.3) from a long filename and [vice versa](./test/short_path/).\n\n## Symbolic links\n\n[Symbolic links](./test/symlink/) are demonstrated across platforms, including Linux, macOS, Windows, MinGW, WSL, and Cygwin.\nWindows symlinks may require setting group policy (Windows Pro) or enabling Windows Developer Mode (non-Pro Windows).\n\n## Syscall\n\n[Example system calls](./test/syscall/) with mild effort towards security and cross-platform compatibility.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscivision%2Fffilesystem-concepts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscivision%2Fffilesystem-concepts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscivision%2Fffilesystem-concepts/lists"}