X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: <20120319091408.GA30682@calimero.vinschen.de> References: <20120318155829 DOT GA21914 AT calimero DOT vinschen DOT de> <20120318191043 DOT GA32177 AT calimero DOT vinschen DOT de> <20120319091408 DOT GA30682 AT calimero DOT vinschen DOT de> Date: Tue, 20 Mar 2012 13:48:29 +0400 Message-ID: Subject: Re: ftell() fails on files in shared folders From: Yuri Gribov To: cygwin AT cygwin DOT com Content-Type: multipart/mixed; boundary=0050450170f2c2e9f204bba993dd X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com --0050450170f2c2e9f204bba993dd Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Corinna, > No, it doesn't change that often. =A01.7.9 is actually a year old, > though. =A0Updating *might* help. > > Btw., assuming you call lseek(fileno(p), SEEK_CUR, 0) rather than > ftell(p), what position does it return? I have rewritten my program to use only low-level API (open, write, lseek) and installed latest Cygwin. It seems that the error is caused by O_RDWR - as soon as I change it to O_WRONLY everything starts to work: Local, O_WRONLY: C:\Users\gribov.y>\\s-cw-head\pgas\a.exe //s-cw-head/c$/test.bin success Local, O_RDWR: C:\Users\gribov.y>\\s-cw-head\pgas\a.exe //s-cw-head/c$/test.bin rw success Remote, O_WRONLY: C:\Users\gribov.y>\\s-cw-head\pgas\a.exe //s-cw-node01/c$/test.bin success Remote, O_RDWR: C:\Users\gribov.y>\\s-cw-head\pgas\a.exe //s-cw-node01/c$/test.bin rw sizeof(data) =3D=3D lseek(fd, 0, SEEK_END) failed at io.c:36 --=20 Best regards, Yuri --0050450170f2c2e9f204bba993dd Content-Type: text/x-csrc; charset=US-ASCII; name="io.c" Content-Disposition: attachment; filename="io.c" Content-Transfer-Encoding: base64 X-Attachment-Id: f_h00r4r5w0 I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1 ZGUgPHN0ZGludC5oPgojaW5jbHVkZSA8ZmNudGwuaD4KCiNkZWZpbmUgQ0hF Q0soY29uZCkgZG8geyBcCglpZiggIShjb25kKSApIHsgXAoJCXByaW50Zigi JXMgZmFpbGVkIGF0ICVzOiVkXG4iLCAjY29uZCwgX19GSUxFX18sIF9fTElO RV9fKTsgXAoJCWV4aXQoMSk7IFwKCX0gfSB3aGlsZSgwKQoKaW50IG1haW4o aW50IGFyZ2MsIGNoYXIgKmFyZ3ZbXSkgewogIGlmKCBhcmdjIDwgMiApIHsK ICAgIGZwcmludGYoc3RkZXJyLCAiU3ludGF4OiBhLmV4ZSBmbmFtZSBbbW9k ZV1cbiIpOwogICAgZXhpdCgxKTsKICB9CgogIGNvbnN0IGNoYXIgKmZuYW1l ID0gYXJndlsxXTsKCiAgaW50IG1vZGUgPSBPX0NSRUFUIHwgT19UUlVOQzsK ICBpZiggYXJnYyA+IDIgJiYgMCA9PSBzdHJjbXAoInJ3IiwgYXJndlsyXSkg KQogICAgbW9kZSB8PSBPX1JEV1I7CiAgZWxzZQogICAgbW9kZSB8PSBPX1dS T05MWTsKCiAgY29uc3QgaW50IHBlcm0gPSBTX0lSVVNSIHwgU19JV1VTUiB8 IFNfSVJHUlAgfCBTX0lXR1JQIHwgU19JUk9USCB8IFNfSVdPVEg7CiAgY29u c3QgdW5zaWduZWQgZGF0YSA9IC0xOwoKICBpbnQgZmQgPSBvcGVuKGZuYW1l LCBtb2RlLCBwZXJtKTsKICBDSEVDSyggLTEgIT0gZmQgKTsKICBjbG9zZShm ZCk7CgogIGZkID0gb3BlbihmbmFtZSwgbW9kZSwgcGVybSk7CiAgQ0hFQ0so IC0xICE9IGZkICk7CiAgQ0hFQ0soIHNpemVvZihkYXRhKSA9PSB3cml0ZShm ZCwgJmRhdGEsIHNpemVvZihkYXRhKSkgKTsKICBDSEVDSyggc2l6ZW9mKGRh dGEpID09IGxzZWVrKGZkLCAwLCBTRUVLX0VORCkgKTsKICBDSEVDSyggc2l6 ZW9mKGRhdGEpID09IGxzZWVrKGZkLCAwLCBTRUVLX0NVUikgKTsKCiAgcHJp bnRmKCJzdWNjZXNzXG4iKTsKCiAgcmV0dXJuIDA7Cn0KCg== --0050450170f2c2e9f204bba993dd Content-Type: text/plain; charset=us-ascii -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple --0050450170f2c2e9f204bba993dd--