I could not reproduce this for now. On Linux, I used:
storescp 1234 -v -xcs 'echo #a on #r to #c' --sort-on-study-uid s
I send two images (different studies) using dcmsend and I get:
I: Association Received
I: Association Acknowledged (Max Send PDV: 16372)
I: Received Store Request (MsgID 1, SC)
RECV: .................................................................................................................................
W: subdirectory for study already exists: ./s_1.3.12.2.1107.5.4.1.12.199705071523410083804
I: storing DICOM file: ./s_1.3.12.2.1107.5.4.1.12.199705071523410083804/SC.1.3.12.2.1107.5.4.1.12.199705071525320942958
W: DICOM file already exists, overwriting: ./s_1.3.12.2.1107.5.4.1.12.199705071523410083804/SC.1.3.12.2.1107.5.4.1.12.199705071525320942958
I: Association Release
I: Association Received
I: Association Acknowledged (Max Send PDV: 16372)
I: Received Store Request (MsgID 1, SC)
RECV: .................................................................................................................................
W: subdirectory for study already exists: ./s_1.3.12.2.1107.5.4.1.12.199705071537340314256
I: storing DICOM file: ./s_1.3.12.2.1107.5.4.1.12.199705071537340314256/SC.1.3.12.2.1107.5.4.1.12.199705071537340316837
W: DICOM file already exists, overwriting: ./s_1.3.12.2.1107.5.4.1.12.199705071537340314256/SC.1.3.12.2.1107.5.4.1.12.199705071537340316837
I: Association Release
DCMSEND on localhost to ANY-SCP
Which looks like the expected behaviour. If end of study is detected by timeout I get a comparable result. E.g. by running
storescp 1234 -v -xcs 'echo #a on #r to #c' --sort-on-study-uid s
and sending a single image one gets:
I: Association Received
I: Association Acknowledged (Max Send PDV: 16372)
I: Received Store Request (MsgID 1, SC)
RECV: .................................................................................................................................
W: subdirectory for study already exists: ./s_1.3.12.2.1107.5.4.1.12.199705071537340314256
I: storing DICOM file: ./s_1.3.12.2.1107.5.4.1.12.199705071537340314256/SC.1.3.12.2.1107.5.4.1.12.199705071537340316837
W: DICOM file already exists, overwriting: ./s_1.3.12.2.1107.5.4.1.12.199705071537340314256/SC.1.3.12.2.1107.5.4.1.12.199705071537340316837
I: Association Release
DCMSEND on localhost to ANY-SCP