Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Can't delete big file (>2GB) under Linux (XFS & Reseirfs) by unlink

by vita555 (Initiate)
on Dec 11, 2002 at 09:14 UTC ( [id://219036]=perlquestion: print w/replies, xml ) Need Help??

vita555 has asked for the wisdom of the Perl Monks concerning the following question:

Hi, monks!

I had discovered all site with "unlink" keyword, but found nothing.

My question is:

Linux tkdrzbkup2.nssmb.com 2.4.18-12smp #1 SMP Fri Jun 14 15:22:49 EDT 2002 i686Linux,Red Hat 7.1, ReseirFS

root@tkdrzbkup2 staging# dd if=/dev/zero of=big_file bs=1M count=3072

3072+0 records in

3072+0 records out

root@tkdrzbkup2 staging# pwd

/export/staging

root@tkdrzbkup2 staging# mount

/dev/rza1 on / type ext2 (rw)

/dev/rze1 on /export type reiserfs (rw)


root@tkdrzbkup2 staging# ls -l

total 3148800

-rw-r--r-- 1 root root 3221225472 Nov 12 09:56 big_file

root@tkdrzbkup2 staging# perl -e 'printf "Deleted %d files\n", unlink "/export/staging/big_file"'"'

Deleted 0 files

For checking:

root@tkdrzbkup2 staging# ls > a

root@tkdrzbkup2 staging# ls -l

total 3148804

-rw-r--r-- 1 root root 11 Nov 12 13:33 a

-rw-r--r-- 1 root root 3221225472 Nov 12 09:56 big_file

root@tkdrzbkup2 staging# perl -e 'printf "Deleted %d files\n", unlink "/export/staging/a"'

Deleted 1 files

Command 'rm':

root@tkdrzbkup2 staging# rm -f big_file

root@tkdrzbkup2 staging# ls -l

total 0

It means, unlink doesn't work with big files.

Perl info:

root@tkdrzbkup2 staging# perl -V

Summary of my perl5 (revision 5.0 version 6 subversion 0) configurat +ion: Platform: osname=linux, osvers=2.2.17-8smp, archname=i386-linux uname='linux porky.devel.redhat.com 2.2.17-8smp #1 smp fri nov 17 16 +:12:17 est 2000 i686 unknown 'config_args='-des -Doptimize=-O2 -march=i386 +-mcpu=i686 -Dcc=gcc -Dcccdlflags=-fPIC -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -Dd_dosuid -Dd_semctl_semun -Di_db -Di_ndbm -D +i_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Uuselargefiles'hint=recommended +, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undefuseperlio=undef d_sfio=undef uselargefiles=unde +f use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=und +ef Compiler: cc='gcc', optimize='-O2 -march=i386 -mcpu=i686', gccversion=2.96 200 +00731 (Red Hat Linux 7.1 2.96-79)cppflags='-fno-strict-aliasing' ccflags ='-fno-strict-aliasing' stdchar='char', d_stdstdio=define, usevfork=false intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4alignbytes=4, usemymalloc=n, prototype=define Linker and Libraries: ld='gcc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -ldl -lm -lc -lcrypt libc=/lib/libc-2.2.2.so, so=so, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: Built under linux Compiled at Mar 23 2001 12:49:50 @INC: /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl
  • Comment on Can't delete big file (>2GB) under Linux (XFS & Reseirfs) by unlink
  • Download Code

Replies are listed 'Best First'.
Re: Can't delete big file (>2GB) under Linux (XFS & Reseirfs) by unlink
by Chmrr (Vicar) on Dec 11, 2002 at 09:46 UTC

    You appear to not have large file support compiled into your perl (see the part of perl -V that reads uselargefiles=undef) See the section on large file support from the perl 5.6 perldelta.

    perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'

      Thank you for good explanation!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://219036]
Approved by zigdon
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-18 13:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found