Bug 55099 - ResultSaver should create intermediate directories
Summary: ResultSaver should create intermediate directories
Status: NEW
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.9
Hardware: All All
: P4 enhancement (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
Depends on:
Reported: 2013-06-13 14:08 UTC by Peter
Modified: 2016-03-15 16:47 UTC (History)
2 users (show)

Patch for ResultSaver (3.78 KB, patch)
2013-08-16 13:24 UTC, Peter
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter 2013-06-13 14:08:41 UTC
A FileNotFoundException is thrown if you use a relative path as 'Filename prefix' and a directory doesn't exist.

jmeter.reporters.ResultSaver: Error creating sample file for PicURL java.io.FileNotFoundException: 
	at java.io.FileOutputStream.open(Native Method)
	at java.io.FileOutputStream.<init>(Unknown Source)
	at java.io.FileOutputStream.<init>(Unknown Source)
	at org.apache.jmeter.reporters.ResultSaver.saveSample(ResultSaver.java:188)
	at org.apache.jmeter.reporters.ResultSaver.processSample(ResultSaver.java:150)
	at org.apache.jmeter.reporters.ResultSaver.sampleOccurred(ResultSaver.java:140)
	at org.apache.jmeter.threads.ListenerNotifier.notifyListeners(ListenerNotifier.java:84)
	at org.apache.jmeter.threads.JMeterThread.notifyListeners(JMeterThread.java:783)
	at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:442)
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
Comment 1 Sebb 2013-06-13 15:33:44 UTC
That's a valid response - the file cannot be found.

What do you expect to happen?
Comment 2 Peter 2013-06-13 19:02:55 UTC
The file is generated at run time. I read the description from JMeter documentation: "Prefix for the generated file names; this can include a directory name."

In my case it would be convenient to generate directories as well because the directory structure depends on the test plan.

To generate directories should be a small modification of ResultSaver.
Comment 3 Peter 2013-08-16 13:24:31 UTC
Created attachment 30737 [details]
Patch for ResultSaver

patch includes a TestCase
Comment 4 The ASF infrastructure team 2022-09-24 20:37:54 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3143