Hard disk write in QNX

Hi,
In windows, if hard disk is formatted, then it is necessary to take lock before we write a data. Is this process needed in QNX also ?

Thanks in advance.
hello

It’s really hard to know how to answer this question, since the premise seems so far off, I doubt I know what your real question is. Here goes.

Error 1
“In windows, if hard disk is formatted…”
If the hard disk isn’t formatted, you can’t write to it. If you can write to the disk, it is formatted. That is unless you are talking about direct sector writes.

Error 2
“… then it is necessary to take lock before we write a data.”
I assume by “take lock” you mean either lock the file or something related.
Well that’s not true. Just like in most OS’s, you can open a file for write, and write to it. No locking is necessary. If the file is already locked, you will have to wait or the open or write will fail.

“Is this process needed in QNX also ?”
Do you need to lock a file before writing in QNX, No.

Its about direct sector write.

In windows, if hard disk is formatted, then it is necessary to release the lock before a sector write. Is this process needed in QNX also(considering the disk is formatted) ?

Well I still don’t know what you are talking about. You are saying that when you have a formatted disk in windows, there is a lock on it which you have to remove before you do a sector write to it? Ok, I can’t imagine why you would want to do this.

However since you ask, there is no lock on a formatted QNX disk, so if you want to do a sector write to it (again I can’t see why you would want to do this), NO! you don’t have to remove the non-existant lock.

Sector write? You mean not writing to a file, but directly writing to a physical hard disk sector? Why would you do that and how? It’s up to the file system to handle this. Or are you writing your own filesystem?