Skip to content

Reject unsupported append mode#1111

Open
fallintoplace wants to merge 1 commit into
rapidsai:mainfrom
fallintoplace:fix/reject-append-mode
Open

Reject unsupported append mode#1111
fallintoplace wants to merge 1 commit into
rapidsai:mainfrom
fallintoplace:fix/reject-append-mode

Conversation

@fallintoplace

Copy link
Copy Markdown

Summary

Reject append mode for CuFileDriver instead of pretending it provides safe append semantics.

What changed

  • reject open(..., "a") with a clear std::invalid_argument
  • reject existing file descriptors that were opened with O_APPEND
  • update the C++ and Python filesystem docs to say append mode is unsupported
  • add a regression test for both string-based open and raw-fd open with append mode

Why

CuFileDriver exposes explicit-offset pread() / pwrite() APIs. That makes append mode a poor fit.

The obvious alternative would be to add O_APPEND, but that is not actually safe here:

  • POSIX defines pwrite() as an explicit-offset write
  • the Linux pwrite(2) man page documents that opening a file with O_APPEND causes pwrite() to append regardless of the supplied offset

So adding O_APPEND would make this API more surprising and more dangerous, not less. Rejecting append mode is the cleaner behavior.

Validation

  • added regression coverage in test_cufile.cpp
  • ran git diff --check
  • attempted local CMake configure, but this machine cannot build the project because FindCUDAToolkit fails to locate nvcc

@fallintoplace fallintoplace requested review from a team as code owners June 27, 2026 22:14
@copy-pr-bot

copy-pr-bot Bot commented Jun 27, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant