Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement remove, remove_all and mkdir #426

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

imaqtkatt
Copy link

Despite the branch name it implements 3 new functions related to the removal of files or directories and the creation of directories

@imaqtkatt imaqtkatt self-assigned this Aug 28, 2024
@developedby
Copy link
Member

Implements both #418 and #420

src/run.cu Outdated
int result = mkdir(name.buf, mode);
free(name.buf);

if (result) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep the var names the same? In the C runtime you called this status.

src/run.cu Outdated
Comment on lines 968 to 969
book->ffns_buf[book->ffns_len++] = (FFn){"DELETE_FILE", io_delete_file};
book->ffns_buf[book->ffns_len++] = (FFn){"DELETE_DIRECTORY", io_delete_directory};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following the convention of using the C/unix name for these functions, it would be better to call them "RM" and "RMDIR".

Also, if we're using "rmdir" we definitely should not also use "delete_directory", either go with one style or the other.

HVM in general prefers short names

tests/programs/io/create_directory.bend Outdated Show resolved Hide resolved
src/run.c Outdated Show resolved Hide resolved
@developedby
Copy link
Member

I've also added some comments on the specs for this issue, I think we need to change the interfaces a little

src/run.cu Outdated Show resolved Hide resolved
build.rs Outdated Show resolved Hide resolved
build.rs Outdated Show resolved Hide resolved
@imaqtkatt imaqtkatt changed the title Implement delete_file, delete_directory and mkdir Implement remove, remove_all and mkdir Sep 3, 2024
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.

3 participants