VirtualBox

Opened 15 years ago

Closed 14 years ago

#4771 closed defect (fixed)

Truncating files does not work on shared folders (Linux guest) => Fixed in SVN/3.0.8

Reported by: Martin Owned by:
Component: shared folders Version: VirtualBox 3.0.6
Keywords: truncate Cc:
Guest type: Linux Host type: other

Description

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);

}

Change History (4)

comment:1 by Martin, 15 years ago

Create something ate the linebreaks ...

#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);

}

comment:2 by Martin, 15 years ago

some more research in existing bugs, this may be related to #3712

comment:3 by Frank Mehnert, 15 years ago

Host type: Windowsother
Summary: truncate files does not work on shared folder (3.0.2) host Vista / guest ubuntuTruncating files does not work on shared folders (Linux guest) => Fixed in SVN
Version: VirtualBox 3.0.2VirtualBox 3.0.6

No, this bug is not related to #3712. Actually this bug was just fixed in SVN and the fix will be part of the next maintenance release. This was a bug (missing case) in the Linux guest additions so make sure to update the additions to verify the fix.

comment:4 by Sander van Leeuwen, 14 years ago

Resolution: fixed
Status: newclosed
Summary: Truncating files does not work on shared folders (Linux guest) => Fixed in SVNTruncating files does not work on shared folders (Linux guest) => Fixed in SVN/3.0.8
Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use