Mailing-List: contact cygwin-apps-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-apps-owner AT sourceware DOT cygnus DOT com List-Subscribe: List-Archive: List-Post: List-Help: , Delivered-To: mailing list cygwin-apps AT sources DOT redhat DOT com From: "Ralf Habacker" To: "Cygwin-Apps" Subject: Problem with perl -i option Date: Wed, 15 Aug 2001 10:45:15 +0200 Message-ID: <000501c12566$9aaa2ba0$651c440a@BRAMSCHE> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Hi, perl has an -i[] option for inplace file changing with an optional backup extension. On linux for example you can use this without explicit defining an backup extension for example "perl -i ... test.txt" The cygwin port differs in that behavior. If you use "perl -i ... test.txt" the file "test.txt" will be deleted. One have to set an explicit file extension "perl -i.bak ... test.txt" for working. I have found this in the current perl version Ralf ---------------------------------------------------------------------- $ perl -V Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration: Platform: osname=cygwin, osvers=1.1.6(0.3032), archname=cygwin uname='cygwin_nt-5.0 fifer 1.1.6(0.3032) 2000-11-21 21:00 i686 unknown ' config_args='-de' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef Compiler: cc='gcc', ccflags ='-DPERL_USE_SAFE_PUTENV -DHAS_SBRK_PROTO -fno-strict-aliasing', optimize='-O2', cppflags='-DPERL_USE_SAFE_PUTENV -DHAS_SBRK_PROTO -fno-strict-aliasing' ccversion='', gccversion='2.95.2-5 19991024 (cygwin experimental)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4 alignbytes=8, usemymalloc=y, prototype=define Linker and Libraries: ld='ld2', ldflags =' -s -L/usr/local/lib' libpth=/usr/local/lib /usr/lib /lib libs=-lgdbm -lcrypt perllibs=-lcrypt libc=/usr/lib/libc.a, so=dll, useshrplib=true, libperl=libperl5_6_1.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' -s' cccdlflags=' ', lddlflags=' -s -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: USE_LARGE_FILES Locally applied patches: v5.6.1-TRIAL1 Built under cygwin Compiled at Dec 21 2000 21:39:40 @INC: /usr/lib/perl5/5.6.1/cygwin /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/cygwin /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl .