Skip to content

fs: ll_mkdir/write -> provider.mkdir/write#1362

Merged
KernelDeimos merged 2 commits intoHeyPuter:mainfrom
XiaochenCui:fs/provider-1354
Jul 29, 2025
Merged

fs: ll_mkdir/write -> provider.mkdir/write#1362
KernelDeimos merged 2 commits intoHeyPuter:mainfrom
XiaochenCui:fs/provider-1354

Conversation

@XiaochenCui
Copy link
Copy Markdown
Contributor

@XiaochenCui XiaochenCui commented Jul 16, 2025

this is a task related to #1354

I moved the mkdir/write logic from ll_mkdir.js/ll_write.js to PuterFSProvider.js with minimal changes.

Test

This PR also passed all the apitest since it's based on #1376

@XiaochenCui XiaochenCui changed the title rfs: ll_mkdir -> provider.mkdir fs: ll_mkdir -> provider.mkdir Jul 16, 2025
@XiaochenCui XiaochenCui marked this pull request as ready for review July 25, 2025 23:12
@XiaochenCui
Copy link
Copy Markdown
Contributor Author

hey @KernelDeimos
This PR is ready for review and merge, it also passed all the apitest since it's based on #1376

if ( ! values.overwrite && ! values.dedupe_name ) {
throw APIError.create('item_with_same_name_exists', null, {
entry_name: target_name,
entry_name: await dest.get('name'),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did target_name have a different value here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah, they are different is this request:

{
  "source": "//admin/api_test/move_cart_3/a/a_file.txt",
  "destination": "//admin/api_test/move_cart_3/b"
}
dest.get('name'): b
target_name: a_file.txt

and we are expecting b in the error:

error_expected = {
code: 'item_with_same_name_exists',
message: 'An item with name `b` already exists.',
entry_name: 'b',
}

It's produced by:

node ./tools/api-tester/apitest.js --config=./tools/api-tester/config.yml --unit --suite=move_cart

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does /admin/api_test/move_cart_3/b already exist in this case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah, exists as a normal file:

immutable =
0
is_dir =
0
is_public =
null
is_shortcut =
0
is_symlink =
0

It's created here:

if ( state['conditions.destinationIsFile'] ) {
await t.write(`${PREFIX}${i}/b`, 'placeholder\n');
} else {

Comment thread src/backend/src/filesystem/ll_operations/ll_mkdir.js Outdated
@XiaochenCui XiaochenCui changed the title fs: ll_mkdir -> provider.mkdir fs: ll_mkdir -> provider.mkdir, ll_write -> provider.write Jul 29, 2025
@XiaochenCui XiaochenCui changed the title fs: ll_mkdir -> provider.mkdir, ll_write -> provider.write fs: ll_mkdir/write -> provider.mkdir/write Jul 29, 2025
@KernelDeimos KernelDeimos merged commit 27c1e62 into HeyPuter:main Jul 29, 2025
4 checks passed
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