filesetup: fix directory creation issues
- Fix double directory prefix concatenation that was happening after
95af8dd57a7a9a564f99492bb1e04bb6d13b95b1 ("filesetup: don't call
create_work_dirs() for ioengine with FIO_DISKLESSIO") refactored some
code
- Stop always using '/' and switch to using FIO_OS_PATH_SEPARATOR when
concatenating the directory value to the filename in set_name_idx()
- Change the permissions directories are created with to have the
execute bit so they can be entered(!)
- Fix bug where filenames that were absolute unix paths would prevent
the creation of intermediate directories
- Remove the configure mkdir test and introduce fio_mkdir to hide mkdir
platform differences
- Make Windows mkdir emulation more robust against multiple slashes
after the drive letter and when dealing dealing with with paths
containing drive letters in general
This commit makes the following work on Windows:
./fio --thread --name=doubleslashtest \
--filename='C\:\\Windows\Temp\fio.tmp' --size=4k --bs=4k --rw=read
The next example now works when D:\1\ exists but D:\1\2\ doesn't:
./fio --thread --name=mkdirtest --directory='D\:\1' \
--filename='2\fio.tmp' --size=4k --bs=4k --rw=read
The following now works on macOS/Linux when /tmp/1/ exists but /tmp/1/2/
doesn't:
./fio --name=mkdirtest --directory='/tmp/1' \
--filename='2/fio.tmp' --size=4k --bs=4k --rw=read
Fixes https://github.com/axboe/fio/issues/784 ,
https://github.com/axboe/fio/issues/864 and
https://github.com/axboe/fio/issues/870
Tested-by: Astolfo Rueda <astolfor@microsoft.com>
Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>