M micro Well-Known Member Licensed User Longtime User Aug 12, 2017 #1 Hi to all I have a strange problem on a product of the comfile technology a industrial Touch with raspberry 3. I can not write on the USB pendrive, or rather the file seems to have been written but the pendrive is empty These are the steps: First of all I create the virtual path of the pendrive mkdir /mnt/usb chmod 777 /mnt/usb Then in the code ceck if device is inserted I find in the /dev the file sdx (sdx1 ..) where x = [a .... z]. If the device is present, mount the path with a shell Code: Copy Dim shmount As Shell shmount.Initialize("shmount", "mount", Array As String("-t", "auto", "/dev/" & hd, "/mnt/usb")) shmount.Run(-1) where hd = sdx1. The shell returns successfully so the mount is ok. After writing the file check if the writing is successful with Code: Copy If File.Exists("/mnt/usb/", fname) Then NotificaShow("", "File " & fname & " salvato correttamente!", "none", 1500) Else NotificaShow("", "Errore salvataggio file " & fname, "none", 1500) End If And in fact the notification tells me that the file is present. A further test I do with winscp viewing the path /mnt/usb and the file is present. But if remove the pendrive and inserted this in a pc the file is not present. Why? I remember that I always did this way and it worked. Thanks.
Hi to all I have a strange problem on a product of the comfile technology a industrial Touch with raspberry 3. I can not write on the USB pendrive, or rather the file seems to have been written but the pendrive is empty These are the steps: First of all I create the virtual path of the pendrive mkdir /mnt/usb chmod 777 /mnt/usb Then in the code ceck if device is inserted I find in the /dev the file sdx (sdx1 ..) where x = [a .... z]. If the device is present, mount the path with a shell Code: Copy Dim shmount As Shell shmount.Initialize("shmount", "mount", Array As String("-t", "auto", "/dev/" & hd, "/mnt/usb")) shmount.Run(-1) where hd = sdx1. The shell returns successfully so the mount is ok. After writing the file check if the writing is successful with Code: Copy If File.Exists("/mnt/usb/", fname) Then NotificaShow("", "File " & fname & " salvato correttamente!", "none", 1500) Else NotificaShow("", "Errore salvataggio file " & fname, "none", 1500) End If And in fact the notification tells me that the file is present. A further test I do with winscp viewing the path /mnt/usb and the file is present. But if remove the pendrive and inserted this in a pc the file is not present. Why? I remember that I always did this way and it worked. Thanks.
M micro Well-Known Member Licensed User Longtime User Aug 13, 2017 #2 solved Applying umount after writing. I do not know if this is a general solution or only for this product. Thanks to all. Upvote 0
solved Applying umount after writing. I do not know if this is a general solution or only for this product. Thanks to all.