Open JaniruTEC opened 4 years ago
@infeo Does Win32 error are usually used by Java developers? Like they would understand easier the usage compared to ntstatus?
I don't want to speak for every Java developer out there, but from my experience it is. As an example, let's look at the case if an object alrady exists:
ERROR_ALREADY_EXISTS
STATUS_OBJECT_NAME_COLLISION
As a Java dev you are used to nio exceptions like FileAlreadyExistsException, which directly translates to the win32 error code in this case.
The filesystem proposed in this PR should be easier for developers to use and more Javaish, and from my point of view the normal developer deals either only with Java or at most the win32API, but not the Kernel. Of course it would be more desireable to do it more the Java way and catch exceptions and translate those directly to the correct error code, but i thought one step at a time (;
this won't replace the old filesystem. A developer has the possiblitly to choose between the more raw filesystem to implement (less Java, more bitmasks and needs to return NTStatus) and the easy one (more Java, gives user land flags and returns win32 codes)
@Liryna What is your opinion? Is it a good plan to use Win32 API codes and flags or should we stick to the Kernel-Layer in the easier-to-use-filesystem?
Thank for your detail! case like FileAlreadyExistsException
is exactly what I was looking for.
I also believe win32 would be a good choice as it make more sense for Java devs 👍
As it was discussed between @JaniruTEC and me: The file system should give a developer the Win32API Flags and should return Win32API error codes, which will be automically converted to an NtStatus code (via
DokanNtStatusFromWin32Error
)