Testing for O_DIRECT support


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Testing for O_DIRECT support
# 1  
Old 06-07-2010
Testing for O_DIRECT support

Is there some was to test if opening with the O_DIRECT flag will work (without writing a C program)?
# 2  
Old 06-07-2010
Unfortunately no. If you do manage to open anything with O_DIRECT though it will be very inefficient, may I ask the purpose here? There may be better ways to do what you want(posix_fadvise, etc.)
# 3  
Old 06-07-2010
When moving data in XFS file systems (using custom software), I can drive the disk arrays harder with non-buffered I/O, thus I like to open with O_DIRECT. That is, direct I/O is *way* faster in this case.

One of the checks I would like to do in a wrapper script is check if direct I/O support is available in the underlying file system to determine what flags to pass to the custom software.
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

What is the difference between o_direct and DAX with ext4 filesystem?

I'm trying to understand the difference between o_direct flag of open system call and dax (direct access) with ext4 filesystem. According to my understanding both bypass page cache. But I'm still unclear about the crucial difference between these 2 techniques. If there is a huge difference... (1 Reply)
Discussion started by: BHASKAR JUPUDI
1 Replies

2. Programming

Writing files using O_DIRECT in C

I am trying to write .pgm images using the O_DIRECT flag in open(). I have a char* buffer which has the image data. I know that I have to align the buffers and have done that using posix_memalign() yet only a part of the image gets written. Has someone used O_DIRECT for writing files... (3 Replies)
Discussion started by: anchit87
3 Replies

3. UNIX for Dummies Questions & Answers

testing

first time use (0 Replies)
Discussion started by: lcharles
0 Replies

4. UNIX for Advanced & Expert Users

testing

what is the difference between white box and black box testing? (1 Reply)
Discussion started by: areef4u
1 Replies

5. UNIX for Advanced & Expert Users

testing

what does one mean in the context of testing... UNIT TESTING & INITIAL LEVEL OF MENU TESTING (2 Replies)
Discussion started by: areef4u
2 Replies
Login or Register to Ask a Question