From: "nobu (Nobuyoshi Nakada) via ruby-core" Date: 2024-05-04T16:37:03+00:00 Subject: [ruby-core:117776] [Ruby master Bug#20471] Problem creating a file on a windows share and copy it afterwards Issue #20471 has been updated by nobu (Nobuyoshi Nakada). budiljak (Benjamin Udiljak) wrote: > I also tried `f.fsync` , `f.fdatasync` , `f.flush`, but it didn't help. Have you tried `sleep 1` (or more seconds) after the `File.open` block? ---------------------------------------- Bug #20471: Problem creating a file on a windows share and copy it afterwards https://bugs.ruby-lang.org/issues/20471#change-108183 * Author: budiljak (Benjamin Udiljak) * Status: Open * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- Hi, in my Rails application I have the requirement to create a file and copy it to another place on the same windows share. But if I write the file with `File` class and try to copy it with `FileUtils.cp` it hangs indefinitely without any error message. I can't even kill the ruby process. You can easily reproduce the bug by entering this in IRB: ``` filename = "/mnt/windows_share/abc"; File.open(filename, 'wb') { |f| f.write("123" * 1000) }; FileUtils.cp(filename, filename + "d") ``` I tested this on a Ubuntu 22.04 server in the AWS cloud. I also tried `f.fsync` , `f.fdatasync` , `f.flush`, but it didn't help. Probably it's a problem in connection with the `cifs-utils` package. Please come back to me if you need further information. Regards! Ben -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/