puter icon indicating copy to clipboard operation
puter copied to clipboard

the 2nd api of `puter.fs.stat` is broken

Open XiaochenCui opened this issue 4 months ago • 2 comments

issue

puter.fs.stat is supposed to accept an option object after the path, but now it's broken

how to reproduce

Input following code in dev console in prod env.

(await puter.fs.stat('~/Desktop').share)
>> undefined

(await puter.fs.stat({path: '~/Desktop', returnPermissions: true})).shares
>> {users: ..., apps: ...}

// it's supposed to return `shares` field
(await puter.fs.stat('~/Desktop', {returnPermissions: true})).shares
>> undefined

cause

the 2nd api of puter.fs.stat use options.options as options, which is different with the 1st api and remained code

options.options:

https://github.com/HeyPuter/puter/blob/9bdb139f7a82ef610e6beb76b91014ac530828a4/src/puter-js/src/modules/FileSystem/operations/stat.js#L12-L18

options:

https://github.com/HeyPuter/puter/blob/5ae8ed98eb2364650df1624209635809b14bafca/src/puter-js/src/modules/FileSystem/operations/stat.js#L51-L58

XiaochenCui avatar Oct 27 '25 18:10 XiaochenCui

Could you clarify this? I'm confused

jelveh avatar Nov 03 '25 01:11 jelveh

Could you clarify this? I'm confused

Thanks for feedback, I just rephrased the issue and added a "how to reproduce" section

XiaochenCui avatar Nov 03 '25 18:11 XiaochenCui