Host: Vista
Guest: Ubuntu9
Vbox 3.0.2
The below c program fails to truncate fails if the file is on a shared folder
The program runs on the guest, so the file is actually a file on the vista host.
- The program works fine, if the file is *not* on a shared folder.
- The program does not works, if the file *is* on a shared folder.
- I can compile it with or without O_EXCL => makes no difference. I did also run the resulting exe as root to be sure.
- The file is found and open did succeed (f has a positive value, usually 3)
- ftruncate also returns success (zero)
this is somewhat similar to bug 2257 (except that piping shorter/empty text (or dev/null) into the file actually works
#include <stdio.h>
#include <fcntl.h>
int main() {
int f = open("/mnt/share/text", O_WRONLY);// | O_EXCL );
printf("%d", f);
ftruncate(f, 0);
close(f);
}