X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Sun, 18 Mar 2012 16:58:29 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: ftell() fails on files in shared folders Message-ID: <20120318155829.GA21914@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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 On Mar 18 18:55, Yuri Gribov wrote: > Hi all, > > I have recently ran into a problem with Cygwin accessing files located > in shared folders. The attached program does fwrite() and then checks > file size with ftell(). Ftell() returns correct results in any of > following situations: > 1) I access local file: c:/test.bin Wrong style. Don't use DOS paths. Use POSIX paths instead, like, in that case, /cygdrive/c/test.bin. > 2) I access file via UNC-address from the same computer: > //server-name/dir/test.out > gribov DOT y AT s-cw-head ~/build/upc/opt > $ ./a.exe > success > > But when I try to access file via UNC-address from a different machine > ftell() starts returning 0 instead of expected 8: > gribov DOT y AT s-cw-head ~/build/upc/opt > $ gcc io.c && run_ms_job -n 1 -network smp a.exe > ftell(p) == sizeof(data) failed at io.c:26 > > Note that the file is created and data is written correctly: > gribov DOT y AT s-cw-head ~/build/upc/opt > $ xxd ~/pgas/test.bin > 0000000: ffff ffff ffff ffff ........ > so there seem to be a problem with ftell() itself. > > Any help/ideas will be much appreciated. I have tried searching the > MLs but have not found anything similiar to my problem. Works for me. I changed your testcase to allow entering the pathname on the command line: $ ./a ./test.bin success $ ./a //this-machine/c\$/cygwin/home/corinna/test/bin success $ ./a //other-machine/c\$/cygwin/home/corinna/test/bin success Either I don't understand your problem description, or you're suffering from some BLODA problem, maybe. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- 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