Comments (11)
Hi @maurosampietro ,
it is right, the context should be the same between CreateFile and CloseFile.
You should also know that there could be different context for the same file. The system is offen going to call CreateFile a multiple time in the same moment. Therefore you will have one new context for each request.
Ex:
#1 CreateFile \test.txt
#2 CreateFile \test.txt
#1 Write
#2 Lock
#1 CloseFile
#2 CloseFile
from dokan-dotnet.
I create a new WriteStream every time CreateFile w/ FileMode.CreateNew is called. How do you usually manage this situation to avoid 'file already in use' exceptions?
(I never get Lock function called but it may not be a problem now)
from dokan-dotnet.
You have to handle sharing mode with https://msdn.microsoft.com/fr-fr/library/system.io.fileshare%28v=vs.110%29.aspx at open.
from dokan-dotnet.
So i'm already doing the right way :) thank you!
from dokan-dotnet.
I'm sorry to bore you but i have a few other question in order to complete my file system...
Suppose i want to copy a file i have on my desktop called 'file.dat' to my volume. The final destination path is '\subdir1\subdir2'. I open explorer browse to this destination folder and paste my file.dat.
In debug i see CreateFile is called w/ FIleMode.CreateNew parameter but the path is missing the actual name of the file: i receive ''\subdir1\subdir2' but i expected '\subdir1\subdir2\file.dat' in order to properly create the file. The operation fails telling me there's not enough space. What's happening here?
If i copy from code the same file in my unit test, i correctly receive '\subdir1\subdir2\file.dat' and I am able to create the file.
from dokan-dotnet.
At first the device open the folder ''\subdir1\subdir2' to be sure that it exist and only after it is going to call you with '\subdir1\subdir2\file.dat'.
Do you check if the request is made for a directory ?
https://github.com/dokan-dev/dokan-dotnet/blob/master/sample/DokanNetMirror/Mirror.cs#L83
https://github.com/dokan-dev/dokan-dotnet/blob/master/sample/DokanNetMirror/Mirror.cs#L121
from dokan-dotnet.
I write on Console any request of create file. I don't seem to receive the proper '\subdir1\subdir2\file.dat' request. I check for directories.
from dokan-dotnet.
Humm so there should be something wrong in your implementation before this call.
It is pretty hard for me to give you advice at this point 😢
Did you start your project by editing the mirror ?
from dokan-dotnet.
You seem quite sure it's something related to my implementation so I'll will investigate some more. Back to you if this persists. thank you.
from dokan-dotnet.
@maurosampietro You can pass in a ConsoleLogger when doing the mount. So you don't need to log your self.
from dokan-dotnet.
@maurosampietro do you still have issues or I can close the ticket ?
from dokan-dotnet.
Related Issues (20)
- Cant Enable Only one OPEN Stream on a file HOT 1
- Is FileSystemSecurity affects something in GetFileSecurity method? HOT 2
- Does the driver have compatibility issues with server 2022? HOT 9
- [Help wanted] Random unmounts after updating from 1.5.0.0 to 2.0.5.1 HOT 2
- FILE SIZE HOT 10
- Locking the entire application on mount HOT 1
- error 0x800705AA Insufficient system resources exist to complete the requested service. HOT 1
- Folder Icon Change HOT 2
- How to disable virtual disk renaming? HOT 1
- DokanNetMirror does not return "." (self) and ".." (parent) directories in `FindFiles` HOT 20
- Encountered infinite recursion for setting SingleThread=false in DOKAN_OPTIONS HOT 1
- Remounted volumes are randomly unmounted after a few seconds HOT 9
- Hardcoded use of date/time and culture in ConsoleLogger HOT 5
- Identifying exact type of file info call from .NET wrapper HOT 6
- `ReadFile`: semantics of `bytesRead` HOT 27
- AccessViolationException in `RentBuffer` HOT 1
- Feature: Async HOT 3
- The volume label is incorrect HOT 2
- Feature: cancellation tokens HOT 1
- Don't know how to mount the DokanInstance... HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dokan-dotnet.