Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
# We'll use defaults from the LLVM style, but with 4 columns indentation.
BasedOnStyle: LLVM
IndentWidth: 3
ColumnLimit: 150
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# top-most EditorConfig file
root = true

[*]
end_of_line = crlf
insert_final_newline = true
trim_trailing_whitespace = true
tab_width = 3

[{*.sh,dockcross,docker-wine}]
end_of_line = lf

[*.{c,h,yml}]
tab_width = 3
163 changes: 163 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Run FileOp CI

on:
workflow_dispatch: # For manual triggering
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, edited]

defaults:
run:
shell: bash

jobs:

spell-check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install spellchecker
run:
npm install -g cspell@8.19.4
- uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46
id: changed-files
with:
separator: ","
- name: Run spellchecker
run: |
# Run spellchecker with changed files
mapfile -d ',' -t added_modified_files < <(printf '%s,' '${{ steps.changed-files.outputs.all_changed_and_modified_files }}')
cspell --config cspell.json --color --show-suggestions "${added_modified_files[@]}"

container-build:
needs:
- spell-check
strategy:
fail-fast: false
matrix:
BuildType:
- Profile
- Release
runs-on: ubuntu-24.04
container:
image: dockcross/windows-static-x64

steps:
- name: Install git
run: |
export DEBIAN_FRONTEND=noninteractive
apt update
apt install -y git
- uses: actions/checkout@v4

- name: Configure
run: |
git config --global --add safe.directory $PWD
./scripts/cmake.configure.sh -DCMAKE_BUILD_TYPE=${{ matrix.BuildType }}
- name: Build
run:
./scripts/cmake.build.sh

- name: Upload ZIP
uses: actions/upload-artifact@v4
with:
name: app-container${{ matrix.BuildType == 'Profile' && '-profile' || ''}}
path: build/FileOp.7z

build:
needs:
- spell-check
strategy:
fail-fast: false
matrix:
BuildType:
- Profile
- Release
runs-on: Windows-latest

steps:
- uses: actions/checkout@v4
- name: Install ninja
run: choco install ninja
- name: Install gcovr
if: ${{ matrix.BuildType == 'Profile' }}
run: pip install git+https://github.com/gcovr/gcovr.git # gcovr==8.3

- name: Configure
run: ./scripts/cmake.configure.sh -DCMAKE_BUILD_TYPE=${{ matrix.BuildType }}
- name: Build
run: ./scripts/cmake.build.sh
- name: Test
run: |
./scripts/cmake.test.sh || ExitCode=$?
echo "::group::build/Testing/Temporary/LastTest.log"
cat build/Testing/Temporary/LastTest.log
echo "::endgroup::"
exit $ExitCode
- name: Run performance test
if: always()
run: ./scripts/run_test_performance.sh 2>&1 | tee performance.txt

- name: Create coverage report
if: ${{ matrix.BuildType == 'Profile' && always() }}
run: |
gcovr \
--filter src/ \
--exclude-noncode-lines build \
--txt coverage.txt \
--markdown coverage.md --markdown-title "Test coverage report" --markdown-file-link 'https://github.com/Spacetown/FileOp/blob/${{ github.sha }}/{file}' \
--json coverage.json --json-pretty \
--html-single-page --html-title "GCOVR report for $(git rev-parse HEAD)" --html-details coverage.html
cat coverage.txt
gcovr --fail-under-line 100.0 --add-tracefile coverage.json > /dev/null
- name: Upload coverage report
if: ${{ matrix.BuildType == 'Profile' && always() }}
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.*

- name: Upload ZIP
if: always()
uses: actions/upload-artifact@v4
with:
name: app-windows${{ matrix.BuildType == 'Profile' && '-profile' || ''}}
path: build/FileOp.7z

- name: Add job summary
if: ${{ matrix.BuildType == 'Profile' && always() }}
run: |
(
cat coverage.md
echo ""
cat performance.txt
) >> $GITHUB_STEP_SUMMARY

deploy:
needs:
- container-build
- build
runs-on: Windows-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: app-*
# cspell:ignore oapp
- name: Test container release build
run: |
7z x -oapp-container app-container/FileOp.7z
./app-container/FileOp.exe --help
- name: Test windows release build
run: |
7z x -oapp-windows app-windows/FileOp.7z
./app-windows/FileOp.exe --help
- name: Test windows profile build
run: |
7z x -oapp-windows-profile app-windows-profile/FileOp.7z
./app-windows-profile/FileOp.exe --help
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.venv/
/build/
/dockcross
95 changes: 95 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@

# Changelog

<!-- cspell:ignore INFDTEP -->

## Unreleased

- First release under BSD 3-Clause License.
- Use CMake and cross compiling with gcc-11.

## 1.8.0

- INFDTEP-2374
- Always use English system error messages.
- INFDTEP-2099
- Add check for unique file names

## 1.7.3

- INFDTEP-2128
- Fix crash if tool is called with /.

## 1.7.2

- INFDTEP-2097
- Fix handling of response files bigger than buffer (0x1FFFF).

## 1.7.1

- INFDTEP-2088
- Fix option `--touch` for `copy` and `move` command. If several
files are copied or moved the target file of the operation was
always the first target file.

## 1.7.0

- INFDTEP-1729
- Add batch to tag tool.
- Fix link to pull request.
- INFDTEP-1992
- Add support for response files.
- INFDTEP-2081
- Add touch command.
- Add option `--touch` to `copy` and `move` commands.
- Restructure tests.

## 1.6.1

- INFDTEP-1550
- Fix crash if given command is unknown.

## 1.6.0

- INFDTEP-1424
- Remove the flush of the buffer in the cat command.

## 1.5.0

- INFDTEP-1404
- Implement option `--target-directory`.
- Internal redesign: Put each command into a single source file.

## 1.4.0

- INFDTEP-1349
- Implement `cat`, `type` and `move` command.

- INFDTEP-1350
- Update to new version of 000_ToolCommon.

## 1.3.0

- INFDTEP-1261
- Update help output and change documentation to markdown file.

- INFDTEP-1262
- Add Jenkinsfile and shell scripts to build.

## 1.2.0

- INFDTEP-1140

- Add support for reparse points (junctions).
- The `remove` command removes the reparse point. The `copy` command copies the content of the reparse point.

## 1.1.0

- INFDTEP-1077
- Add support for wildcard in paths except `mkdir` command and the target for the `copy` command.
- Add version information to PE header of executable.

## 1.0.0

- INFDTEP-1058
- First implementation of FileOp.exe.
47 changes: 47 additions & 0 deletions FileOp.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"folders": [
{
"path": "."
}
],
"settings": {
"actionButtons": {
"commands": [
{
"name": "Setup env",
"command": "docker run --rm --platform linux/amd64 dockcross/windows-static-x64 > ./dockcross && chmod +x ./dockcross",
"singleInstance": true
},
{
"name": "Configure (Profile)",
"command": "./dockcross --args '--platform linux/amd64' bash -c './scripts/cmake.configure.sh -DCMAKE_BUILD_TYPE=Profile'",
"singleInstance": true
},
{
"name": "Configure (Release)",
"command": "./dockcross --args '--platform linux/amd64' bash -c './scripts/cmake.configure.sh -DCMAKE_BUILD_TYPE=Release'",
"singleInstance": true
},
{
"name": "Build",
"command": "./dockcross --args '--platform linux/amd64' bash -c './scripts/cmake.build.sh'",
"singleInstance": true
}
],
"defaultColor": "white",
"reloadButton": "↻",
"loadNpmCommands": false
},
"editor.formatOnSave": true
},
"extensions": {
// cspell:disable
"recommendations": [
"seunlanlege.action-buttons",
"streetsidesoftware.code-spell-checker",
"EditorConfig.EditorConfig",
"ms-vscode.cpptools-extension-pack"
]
// cspell:enable
}
}
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
BSD 3-Clause License

Copyright (c) 2024, ZF-Group
Copyright (c) 2020-2025, ZF-Group
Copyright (c) 2025, FileOp authors

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

# FileOp

Tool for general file operations under Windows with support of file names longer than MAX_PATH (260 characters).

## Background

Windows command line tools only support paths with a maximum length of 260 characters.
As workaround you need to subst the directory to a drive letter and delete the sub
tree from there.

## Directory layout

dir | description
--- | ---
`build` | *ignored*: Storage of build-results
`src` | Storage for source files
`tests` | Storage for test scripts

## Development

For development a workspace for `Visual Studio Code` is configured together with a cross compiler
running under docker.

### Build

The project uses CMake and ninja for building the executable. The CMake configuration step is executed by
calling [scripts/cmake.configure.sh](./scripts/cmake.configure.sh) and the build by calling
[scripts/cmake.build.sh](./scripts/cmake.build.sh). In the status bar of the IDE there are buttons to
execute the tools.

### Test

To test the generated artifacts call `.\tools\test.cmd` or use `Terminal`->`Run Task...`->`Test` in the IDE.
Loading