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

file util other functions spec and header #258

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

samrach9
Copy link
Contributor

No description provided.

MOCKABLE_FUNCTION(, bool, file_util_set_file_pointer_ex, HANDLE, handle_input, LARGE_INTEGER, distance_to_move, PLARGE_INTEGER, new_file_pointer, uint32_t, move_method);
```

If there are any failures, `file_util_set_file_pointer_ex` shall fail and return false.
Copy link
Contributor

@mattdurak mattdurak Jul 21, 2023

Choose a reason for hiding this comment

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

missing the description sentence, here and below #Resolved


`file_util_set_end_of_file` shall succeed and return true.

### file_util_write_file_ex
Copy link
Contributor

@mattdurak mattdurak Jul 21, 2023

Choose a reason for hiding this comment

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

file_util_write_file_ex

Don't we need an API which matches the usage of bsdl_file_ll.c in block store? As in an asynchronous IO? How will this function be used in block store? #Pending

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We decided to implement a CreateThreadpoolIO. Then the write file function would go within that. So that is something I will be working on implementing now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah that makes sense, I suppose this will be updated with some additional parameter which is an OVERLAPPED* on win32 and something equivalent on Linux

MOCKABLE_FUNCTION(, bool, file_util_get_file_size, PLARGE_INTEGER*, file_size, HANDLE, handle_input);
```

`file_util_get_file_size_ex` implements the GetFileSizeEx function in Linux.
Copy link
Contributor

@mattdurak mattdurak Jul 21, 2023

Choose a reason for hiding this comment

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

GetFileSizeEx

backticks #Resolved

MOCKABLE_FUNCTION(, bool, file_util_get_file_size, PLARGE_INTEGER*, file_size, HANDLE, handle_input);
```

`file_util_get_file_size_ex` implements the GetFileSizeEx function in Linux.
Copy link
Contributor

@mattdurak mattdurak Jul 21, 2023

Choose a reason for hiding this comment

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

in Linux.

seems like above we mention what Linux API's we call to implement these, could be nice for these functions as well for reading at a glance. #Resolved


If there are any failures, `file_util_get_file_size_ex` shall fail and return false.

`file_util_get_file_size_ex` shall succeed and return true.
Copy link
Contributor

@mattdurak mattdurak Jul 21, 2023

Choose a reason for hiding this comment

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

nit: should go after the "shall call stat..." line #Resolved

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.

2 participants