delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/03/20/05:49:01

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: <CAJOtW+5qwWvN84mJJ=NR3TgZE5s7jz8jpLTaN=+h1hv5Ob29XQ AT mail DOT gmail DOT com> <20120318155829 DOT GA21914 AT calimero DOT vinschen DOT de> <CAJOtW+4fMX_EEOBWhn0d6VPU7oq+k_Rx1CGYe4O16ccsNRV4ZA AT mail DOT gmail DOT com> <CAJOtW+4ZCvk3NarGn1qOFF-A+ZbFjithPJE8Ms-7FNFMH63A7Q AT mail DOT gmail DOT com> <20120318191043 DOT GA32177 AT calimero DOT vinschen DOT de> <CAJOtW+4UcSdbOqfch8Kzjh90FJP5ebtx-JJ7t8pGV2QZXiQ69A AT mail DOT gmail DOT com> <20120319091408 DOT GA30682 AT calimero DOT vinschen DOT de>
Date: Tue, 20 Mar 2012 13:48:29 +0400
Message-ID: <CAJOtW+5Mf9uYfe6x8+HsDxWyUmT11DFvDAs1QE00uj5uOayfaA@mail.gmail.com>
Subject: Re: ftell() fails on files in shared folders
From: Yuri Gribov <tetra2005 AT googlemail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019