winnfsd / vagrant-winnfsd

Manage and adds support for NFS for Vagrant on Windows.
Other
567 stars 62 forks source link

NFS and PHP file_put_contents() #23

Closed Krafcu closed 9 years ago

Krafcu commented 10 years ago

Hi there. First of all thanks for this great plugin.

I am runing LAMP stack site development and share project files from my host windows machine to the linux vagrant virtual machine using NFS (thanks to your plugin). Pretty standard PHP development environment.

I am having problem with php function file_put_contents. As default it is supossed to overwrite the file but what I'm getting using NFS is only partialy overwritten file. Let me show by example:

file_put_contents("test.txt", "test\r\ntest\r\ntest\r\ntest\r\n"); Creates new file test.txt if it doesn't exists and puts four lines of test text in the file:

test
test
test
test

Now let say I want to overwrite the file using the same command and put few less lines changed: file_put_contents("test.txt", "test changed\r\n");

What I should be getting is this:

test changed

But what I get is:

test changed
st
test

So the file is not completely overwritten but only the few new bits from the begining of the file are changed and the rest is still there.

I also checked the behaviour using standard virtualbox "Shared Folders" feature and on diffrent machine (Macbook Air) where NFS is working by default so I don't need the plugin there and they both are working fine fully overwriting the file.

Could you please look into this matter? I really have no idea is it only the plugin or maybe there is a bug in winnfsd NFS implementation.

This is what my log displays when i change the file:

NFS GETATTR D:\vagrant\code\framework\test.txt  OK
NFS GETATTR D:\vagrant\code\framework\test.txt  OK
NFS ACCESS D:\vagrant\code\framework\test.txt  OK
NFS SETATTR D:\vagrant\code\framework\test.txt  OK
NFS WRITE D:\vagrant\code\framework\test.txt  OK
jayvdg commented 10 years ago

All the plugin really does is start the WinNFSd server for you. I'd report the bug here:

https://bitbucket.org/jankowfsky/winnfsd/

GM-Alex commented 9 years ago

Seems for me a duplicate of #22 (Use this as reference because it's the one with the most information).