Skip to content

[C++] Reviewing the rename call in LocalFileSystem::Move. #39385

@anjakefala

Description

@anjakefala

Describe the enhancement requested

LocalFileSystem::Move on non-Windows, calls rename: https://github.com/apache/arrow/blob/main/cpp/src/arrow/filesystem/localfs.cc#L585. It then does a check for -1, and prints the error.

While the rename system call and Posix standard do specify that a return value of -1 is expected for error calls, the C++ reference specifies that a "non-zero" is returned upon error.

I have two questions:

  1. Is the rename that is being called in LocalFileSystem::Move the one in std::? Should it be prefaced with std::?
  2. Should the check be changed to a non-zero check, as opposed to a -1 check? Is there is a possibility that std::rename returns a different number other than -1 upon error?

Component(s)

C++

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions