Opened at 2021-10-20T15:31:11Z
Last modified at 2021-10-20T15:32:58Z
#3818 new defect
Writing at offset=0 using REST API fails for empty files
Reported by: | derkades | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | undecided |
Component: | unknown | Version: | n/a |
Keywords: | Cc: | ||
Launchpad Bug: |
Description (last modified by derkades)
Trying to write a single byte at offset 0 to an empty SDMF file:
FILE_CAP=$(curl -X PUT 'http://10.0.1.1:26551/uri?format=sdmf') curl -X PUT --data a "http://10.0.1.1:26551/uri/$FILE_CAP?offset=0" > error1.html
or MDMF:
FILE_CAP=$(curl -X PUT 'http://10.0.1.1:26551/uri?format=mdmf') curl -X PUT --data a "http://10.0.1.1:26551/uri/$FILE_CAP?offset=0" > error2.html
Please find error files attached.
No offset works:
curl -X PUT --data a "http://10.0.1.1:26551/uri/$FILE_CAP"
Now that the file contains 1 byte ('a'), we can write at offset=1 to make it 2 bytes long ('aa'):
curl -X PUT --data a "http://10.0.1.1:26551/uri/$FILE_CAP?offset=1"
Also overwriting the first byte seems to work, but actually overwrites the entire file (unrelated issue?):
curl -X PUT --data b "http://10.0.1.1:26551/uri/$FILE_CAP?offset=0"
The file now contains 'b', while I would expect 'ba'.
Attachments (2)
Change History (3)
Changed at 2021-10-20T15:31:28Z by derkades
comment:1 Changed at 2021-10-20T15:32:58Z by derkades
- Description modified (diff)
Note: See
TracTickets for help on using
tickets.
SDMF error