Re: Linux Directory Copy Modules that Won't

2025-02-01 Thread Martin McCormick
”", "\"/weekly/\"" ); > > It looks like you are giving dircopy only one argument: "\"weekly\", > \"/weekly/\””. The profile for dircopy is: > > dircopy( $orig, $new, [$buf] ); > > To debug the probem further, write a sho

Re: Linux Directory Copy Modules that Won't

2025-02-01 Thread Jesus Lozano Mosterin
it is nothing to > > do with permissions as I can sit here and execute a command from > > the shell like: > > > > date >/weekly or whatever the mounted drive is called and the command > > succeeds normally. > > > > Here is the first part of the progr

Re: Linux Directory Copy Modules that Won't

2025-02-01 Thread Jim Gibson via beginners
\"weekly\”", "\"/weekly/\"" ); It looks like you are giving dircopy only one argument: "\"weekly\", \"/weekly/\””. The profile for dircopy is: dircopy( $orig, $new, [$buf] ); To debug the probem further, write a short-as-possible program that co

Re: Linux Directory Copy Modules that Won't

2025-02-01 Thread Ruprecht Helms (privat)
irst part of the program which is 137 lines long and nothing else is failing except for the directory copies: #!/usr/bin/perl -w use strict; use warnings::unused; use IO::Handle; use File::HomeDir; use Cwd qw(getcwd); #use File::Copy "cp"; use File::Copy::Recursive qw(fcopy rcopy dircopy fmove

Linux Directory Copy Modules that Won't

2025-02-01 Thread Martin McCormick
he command succeeds normally. Here is the first part of the program which is 137 lines long and nothing else is failing except for the directory copies: #!/usr/bin/perl -w use strict; use warnings::unused; use IO::Handle; use File::HomeDir; use Cwd qw(getcwd); #use File::Copy "cp&quo

Re: Trying to set the iCloud directory in Perl, but failing

2021-08-13 Thread wagsworld48 via beginners
dav interface. > > > On 2021/8/14 7:56 上午, Robert Wohlfarth wrote: > > The leading tilde ("~") is the problem. It's specific to the shell. Perl > > doesn't recognize it. Perl treats that first tilde as a directory. The > > error is telling you that a directo

Re: Trying to set the iCloud directory in Perl, but failing

2021-08-13 Thread Ken N
I remember I once connected to iCloud from perl via their webdav interface. On 2021/8/14 7:56 上午, Robert Wohlfarth wrote: The leading tilde ("~") is the problem. It's specific to the shell. Perl doesn't recognize it. Perl treats that first tilde as a directory. The error i

Re: Trying to set the iCloud directory in Perl, but failing

2021-08-13 Thread Robert Wohlfarth
The leading tilde ("~") is the problem. It's specific to the shell. Perl doesn't recognize it. Perl treats that first tilde as a directory. The error is telling you that a directory named "~" doesn't exist. You can use the full path name, like this: my $MyiClo

Trying to set the iCloud directory in Perl, but failing

2021-08-13 Thread wagsworld48 via beginners
I have: my $MyiCloudLoc = q[~/Library/Mobile\ Documents/com~apple~CloudDocs]; Then: chdir($MyiCloudLoc) or die "$!"; Error is “no such file or directory” Yet if I do the following in terminal: Cd  ~/Library/Mobile\ Documents/com~apple~CloudDocs It changes to that directory. Seems s

Re: lib/auto/IO/Compress/Compress.a: No such file or directory

2020-01-28 Thread Jeffrey Walton
ode/Normalize/Normalize.a > > lib/auto/Encode/Byte/Byte.a lib/auto/Encode/CN/CN.a > > lib/auto/Encode/EBCDIC/EBCDIC.a lib/auto/Encode/JP/JP.a > > lib/auto/Encode/KR/KR.a lib/auto/Encode/Symbol/Symbol.a > > lib/auto/Encode/TW/TW.a lib/auto/Encode/Unicode/Unicode.a libperl.a &g

Re: lib/auto/IO/Compress/Compress.a: No such file or directory

2020-01-28 Thread Jeffrey Walton
> lib/auto/Encode/TW/TW.a lib/auto/Encode/Unicode/Unicode.a libperl.a > `cat ext.libs` /home/jwalton/bootstrap/lib/libdb.a -lm > /usr/lib/libcrypt.a > cc: lib/auto/IO/Compress/Compress.a: No such file or directory > > Here is the full build: https://pastebin.com/Pu0cYi25 How does

lib/auto/IO/Compress/Compress.a: No such file or directory

2020-01-28 Thread Jeffrey Walton
a lib/auto/Encode/JP/JP.a lib/auto/Encode/KR/KR.a lib/auto/Encode/Symbol/Symbol.a lib/auto/Encode/TW/TW.a lib/auto/Encode/Unicode/Unicode.a libperl.a `cat ext.libs` /home/jwalton/bootstrap/lib/libdb.a -lm /usr/lib/libcrypt.a cc: lib/auto/IO/Compress/Compress.a: No such file or directory Here is the

Re: File::Find report file count per directory

2017-06-28 Thread Harry Putnam
jimsgib...@gmail.com (Jim Gibson) writes: [...] > I don’t see how the code you have posted can possibly produce the > output you have reported. The code above looks like error checking > that the user of the program has entered one argument, and that > argument is the name of a dire

Re: File::Find report file count per directory

2017-06-28 Thread Harry Putnam
jimsgib...@gmail.com (Jim Gibson) writes: [...] > I don’t see how the code you have posted can possibly produce the > output you have reported. The code above looks like error checking > that the user of the program has entered one argument, and that > argument is the name of a dire

Re: File::Find report file count per directory

2017-06-28 Thread Jim Gibson
On Jun 28, 2017, at 2:10 PM, Harry Putnam wrote: > > 1) I want to count numeric named files in each directory. > > 2) I want to capture the name of the directory those files are in > > 3) I want to print the directory name and the count (if any) for each > directory. >

File::Find report file count per directory

2017-06-28 Thread Harry Putnam
1) I want to count numeric named files in each directory. 2) I want to capture the name of the directory those files are in 3) I want to print the directory name and the count (if any) for each directory. I know that all the information I want to extract is available in File::Find. Just

Re: how to perform file and directory metadata tests/queries in Perl with elevated privs?

2016-04-22 Thread Shlomi Fish
Hi Ken, On Thu, 21 Apr 2016 10:47:08 -0700 Kenneth Wolcott wrote: > Hi; > > I try not to run my scripts with elevated privilege. > > But sometimes files, directories and filesystems need to be accessed > via elevated privilege. > > So how to do this? > > If I'm logged in as an ordina

Re: how to perform file and directory metadata tests/queries in Perl with elevated privs?

2016-04-22 Thread Rubén Llorente
El Fri, 22 Apr 2016 10:28:04 +, Rubén Llorente escribió: > > SUID and SGID are tricky matters. Common security advice is not to have > SUID or SGID scripts because sometimes you can cause a race condition > and run arbitrary scripts with the privileges of the owner of the > script. Which is r

Re: how to perform file and directory metadata tests/queries in Perl with elevated privs?

2016-04-22 Thread Rubén Llorente
El Fri, 22 Apr 2016 13:05:28 +0300, Shlomi Fish escribió: > The way I understand the basic Unix permissions and privileges model > (which is before SELinux and other more complex stuff was introduced) > the way you gain root or other users privileges is by executing (using > EXECVE - possibly afte

Re: how to perform file and directory metadata tests/queries in Perl with elevated privs?

2016-04-22 Thread Shlomi Fish
Hi Ken, On Thu, 21 Apr 2016 10:47:08 -0700 Kenneth Wolcott wrote: > Hi; > > I try not to run my scripts with elevated privilege. > > But sometimes files, directories and filesystems need to be accessed > via elevated privilege. > > So how to do this? > > If I'm logged in as an ordina

how to perform file and directory metadata tests/queries in Perl with elevated privs?

2016-04-21 Thread Kenneth Wolcott
Hi; I try not to run my scripts with elevated privilege. But sometimes files, directories and filesystems need to be accessed via elevated privilege. So how to do this? If I'm logged in as an ordinary user and run a script (manually or under crontab), the "-d", "-f", "-r" type of file m

Re: windows directory path not working in perl

2016-03-02 Thread Ken Slater
On Wed, Mar 2, 2016 at 5:40 AM, Arghya Das wrote: > #copies 1 file to another > > use warnings; > > use File::Copy; > > copy("FILE1.txt","new_file.txt"); > > > > This script works if FILE1.txt is in current directory of windows but when >

windows directory path not working in perl

2016-03-02 Thread Arghya Das
#copies 1 file to another use warnings; use File::Copy; copy("FILE1.txt","new_file.txt"); This script works if FILE1.txt is in current directory of windows but when i try to give a full path to a file like : "C:\Folder1\FILE1.txt" it doesnt work. This is t

Re: AW: Traversing directory recursively

2015-07-10 Thread Uri Guttman
On 07/10/2015 04:50 AM, Nagy Tamas (TVI-GmbH) wrote: Hi, That works fine, thx: sub Traverse { find({wanted => sub { if(-d $File::Find::name) { $writer->startTag("Folder", "Name" => $File::Find::name); } }, postproce

AW: Traversing directory recursively

2015-07-10 Thread Nagy Tamas (TVI-GmbH)
$writer->endTag("Folder"); } }, "c:\\ph\\" ); } -Ursprüngliche Nachricht- Von: Nagy Tamas (TVI-GmbH) Gesendet: Freitag, 10. Juli 2015 09:16 An: $Bill; beginners@perl.org Betreff: AW: Traversing directory recursive

AW: Traversing directory recursively

2015-07-10 Thread Nagy Tamas (TVI-GmbH)
Hi, I also tried the $writer = shift, but it drops an error for XML syntax. This version traverses only into one directory branch. So it opens a dir and goes down, list Everything but forgets to go down into the second or third dir. What does shift do actually? It tells that it is about array

Re: Traversing directory recursively

2015-07-09 Thread Uri Guttman
On 07/09/2015 01:19 PM, Jim Gibson wrote: It is because you are calling the Traverse() subroutine with two arguments to recurse a directory tree, but you are not using the arguments. Each call to Traverse uses the global $dir variable as the root of the tree, so it will never terminate. You

Re: Traversing directory recursively

2015-07-09 Thread Jim Gibson
># make file > branch > > $writer->emptyTag("Object", "Name" => $actualdir.$file); > >} >

Traversing directory recursively

2015-07-09 Thread Nagy Tamas (TVI-GmbH)
Hi, So I have a better version. But if it goes down in the recursion tree, at the end it goes into infinite loop, because there is no other dir inside the last dir in the tree. At this point it has to step back. But instead of stepping back it goes into infinite loop. Why? sub Traverse {

Re: Can't delete directory entry in AD using Net::LDAP

2011-10-27 Thread Tessio Fechine
Thanks a lot! Also searching for "ERROR_DS_REFERRAL" gave me a lot of information about Windows/AD errors. 2011/10/27 Rob Dixon > On 26/10/2011 23:01, Tessio Fechine wrote: > >> Hello, >> I'm trying to delete a user entry in Active Directory using this code: &

Re: Can't delete directory entry in AD using Net::LDAP

2011-10-26 Thread Rob Dixon
On 26/10/2011 23:01, Tessio Fechine wrote: Hello, I'm trying to delete a user entry in Active Directory using this code: #!/usr/bin/perl -w use strict; use Net::LDAP; my $server = '192.168.56.1'; my $port = '389'; my $mesg; my $c = Net::LDAP->new($server,

Can't delete directory entry in AD using Net::LDAP

2011-10-26 Thread Tessio Fechine
Hello, I'm trying to delete a user entry in Active Directory using this code: #!/usr/bin/perl -w use strict; use Net::LDAP; my $server = '192.168.56.1'; my $port = '389'; my $mesg; my $c = Net::LDAP->new($server, port => $port) or die "Unable to co

Re: open files in a directory

2011-08-01 Thread Shlomi Fish
Hi John, a few comments on your code (some of which was derived from the OP's). On Mon, 01 Aug 2011 00:26:29 -0700 "John W. Krahn" wrote: > homedw wrote: > > hi all, > > Hello, > > > > i want to open some files in a directory, you can see the

Re: open files in a directory

2011-08-01 Thread timothy adigun
rote: > > > homedw wrote: > > > >> hi all, > >> > > > > Hello, > > > > > > > > i want to open some tha files in a directory, you can see the details > >> below, > >> > >> #!/usr/bin/perl -w > >&g

Re: open files in a directory

2011-08-01 Thread timothy adigun
a large file in another drive and it worked perfectly, after the correction stated above was used! Regards On Mon, Aug 1, 2011 at 8:09 AM, homedw wrote: > hi all, > > i want to open some files in a directory, you can see the details below, > > #!/usr/bin/perl -w > use strict; >

Re: open files in a directory

2011-08-01 Thread Emeka
I guess that $sum should be "my $sum" before using it. Emeka On Mon, Aug 1, 2011 at 8:26 AM, John W. Krahn wrote: > homedw wrote: > >> hi all, >> > > Hello, > > > > i want to open some tha files in a directory, you can see the details &g

Re: open files in a directory

2011-08-01 Thread John W. Krahn
homedw wrote: hi all, Hello, i want to open some files in a directory, you can see the details below, #!/usr/bin/perl -w use strict; opendir (FH,'C:\Player'); chdir 'C:\Player'; for my $file(readdir FH) { open DH,"$file&qu

open files in a directory

2011-08-01 Thread homedw
hi all, i want to open some files in a directory, you can see the details below, #!/usr/bin/perl -w use strict; opendir (FH,'C:\Player'); chdir 'C:\Player'; for my $file(readdir FH) { open DH,"$file"; foreach my $line() { whi

Re: it told me that Can't open perl script " hello.p1" No such file or directory

2011-05-23 Thread Thomas Lingmann
o,word!\n”; > > and save it under e:\ as perl.p1 > > but when I run it with the window commend line as > > > E:\ perl hello.p1 it told me that Can't open perl script " > hello.p1" No such file or directory!! > > how can I solve it thank you!!!

Re: it told me that Can't open perl script " hello.p1" No such file or directory

2011-05-23 Thread Kenneth Wolcott
he window commend line as > > > E:\ perl hello.p1         it told me that Can't open perl script " > hello.p1"  No such file or directory!! > > how can I solve it  thank you!!! > "p1" is different than "pl". "pl" is the usual suf

Re: it told me that Can't open perl script " hello.p1" No such file or directory

2011-05-23 Thread Alexey Mishustin
ndow commend line as > > >E:\ perl hello.p1 it told me that Can't open perl script " >hello.p1" No such file or directory!! > >how can I solve it thank you!!! Maybe hello.pl, not hello.p1? 'pl' (abbreviated from 'Perl') is the co

it told me that Can't open perl script " hello.p1" No such file or directory

2011-05-23 Thread Gang Cheng
cript " hello.p1" No such file or directory!! how can I solve it thank you!!!

Re: MRF-ERROR: Is a directory

2011-03-17 Thread Peter Scott
On Thu, 17 Mar 2011 02:26:06 +0700, indrag wrote: > this is the code: > > #!/usr/bin/perl > > use NetCDF; The error is coming out of NetCDF.pm. Check all of the calls you make to functions from that module against its documentation. Did you write the progr

Re: MRF-ERROR: Is a directory

2011-03-16 Thread Uri Guttman
> "i" == indrag writes: i> #!/usr/bin/perl i> use NetCDF; use strict ; use warnings ; those ask perl to help you. always use them. you will have to declare all your vars with my when using strict but that is the point. i> if(@ARGV == 6){ that makes no sense. you look for 6 args i

Re: MRF-ERROR: Is a directory

2011-03-16 Thread indrag
} if($AZ[$j] > $AZ1 && $AZ[$j] < $AZ2 ){ $VEL[$j*$BIN_NUM+$i]= $missing_value[0]; } } } NetCDF::varput($ncid,$varid,\@start,\@count,\@VEL); NetCDF::close($ncid); } if($opt_

Re: MRF-ERROR: Is a directory

2011-03-16 Thread Bob goolsby
Mornin' -- Please include the code that is giving you this error, otherwise we are hypothesizing in vacuum. Off hand, I say that you are performing some file operation that is not permitted for directories, and you have crossed your hands and handed your code a directory rather than a file.

Re: MRF-ERROR: Is a directory

2011-03-16 Thread Parag Kalra
On Wed, Mar 16, 2011 at 11:44 AM, wrote: > how to overcome this error : > > MRF-ERROR: Is a directory > > > Please post the entire code. ~Parag

Re: MRF-ERROR: Is a directory

2011-03-16 Thread Shawn H Corey
On 11-03-16 02:44 PM, ind...@students.itb.ac.id wrote: how to overcome this error : MRF-ERROR: Is a directory Please show the code. -- Just my 0.0002 million dollars worth, Shawn Confusion is the first step of understanding. Programming is as much about organization and

MRF-ERROR: Is a directory

2011-03-16 Thread indrag
how to overcome this error : MRF-ERROR: Is a directory regards, Indra -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Scan/Parse directory for "newest" file, print file timestamp and compute date/time difference - Some advice please

2011-03-02 Thread Jim Gibson
On 3/2/11 Wed Mar 2, 2011 8:34 AM, "newbie01 perl" scribbled: > Hi all, > > Am wanting to get some advise on how to write this Perl script. > > I have a backup directory that I have to check for the existence of file/s > and if the latest file that exist there

Re: Scan/Parse directory for "newest" file, print file timestamp and compute date/time difference - Some advice please

2011-03-02 Thread Shawn H Corey
On 11-03-02 12:31 PM, shawn wilson wrote: Seems like more of a pain for a modest gain in speed to me. I like find and dt because its quick and easy. Either way though. No, because you don't have to worry about daylight-savings time or switching time zones. Seconds from the epoch is the same o

Re: Scan/Parse directory for "newest" file, print file timestamp and compute date/time difference - Some advice please

2011-03-02 Thread shawn wilson
On Mar 2, 2011 12:16 PM, "Shawn H Corey" wrote: > > On 11-03-02 12:12 PM, shawn wilson wrote: >> >> First, use File::Find to get your info (or you could use system( ls -l ) and >> split - either way). To compare your time stamps, use DateTime and do dt1 - >> dt2 >> > > No. If you can do all your

Re: Scan/Parse directory for "newest" file, print file timestamp and compute date/time difference - Some advice please

2011-03-02 Thread Shawn H Corey
On 11-03-02 12:12 PM, shawn wilson wrote: First, use File::Find to get your info (or you could use system( ls -l ) and split - either way). To compare your time stamps, use DateTime and do dt1 - dt2 No. If you can do all your calculations using seconds from the epoch, then do so. Only conve

Re: Scan/Parse directory for "newest" file, print file timestamp and compute date/time difference - Some advice please

2011-03-02 Thread shawn wilson
First, use File::Find to get your info (or you could use system( ls -l ) and split - either way). To compare your time stamps, use DateTime and do dt1 - dt2

Re: Scan/Parse directory for "newest" file, print file timestamp and compute date/time difference - Some advice please

2011-03-02 Thread Shawn H Corey
On 11-03-02 11:34 AM, newbie01 perl wrote: My main hurdle is the file timestamp and date arithmetic part. Frm Google'ing, am leaning towards using stat which am hoping will work on both Unix and Windows. Some guidance will be much appreciated. Thanks in advance. Use the stat function to get th

Scan/Parse directory for "newest" file, print file timestamp and compute date/time difference - Some advice please

2011-03-02 Thread newbie01 perl
Hi all, Am wanting to get some advise on how to write this Perl script. I have a backup directory that I have to check for the existence of file/s and if the latest file that exist there is 2 days old, that means I have a problem and had to send an email notification. To illustrate if, for

Re: Sorting files in a directory, without using any OS specific command, ordered by modified timestamp

2010-12-01 Thread Mark
> On Dec 1, 7:31 am, jwkr...@shaw.ca ("John W. Krahn") wrote: > > Correction: > > my @sorted_files_in_directory = >      map $_->[ 1 ], >      sort { $a->[ 0 ] <=> $b->[ 0 ] } >      map { ( stat "$directory_name/$_" )[ 9 ], $_ } map { [ ( stat "$directory_name/$_" )[ 9 ], $_ ] } >    

Re: Sorting files in a directory, without using any OS specific command, ordered by modified timestamp

2010-12-01 Thread Shlomi Fish
On Wednesday 01 December 2010 16:57:07 John W. Krahn wrote: > Amit Saxena wrote: > > Hi all, > > { > > > > next if ( ( $filename eq "." ) or ( $filename eq ".." ) ); > > > > push ( @files_in_directory, $filename ); > > > > } > > Since all you are doing is populating t

Re: Sorting files in a directory, without using any OS specific command, ordered by modified timestamp

2010-12-01 Thread Shawn H Corey
On 10-12-01 09:57 AM, John W. Krahn wrote: Or just: print map( "$_\n", @files_in_directory ), "\n"; print map( "$_\n", @sorted_files_in_directory ), "\n"; -- Just my 0.0002 million dollars worth, Shawn Programming is as much about organization and communication as it is about coding.

Re: Sorting files in a directory, without using any OS specific command, ordered by modified timestamp

2010-12-01 Thread John W. Krahn
r", you'd better prepend the directory in question. Otherwise, because we didn't "chdir" there, it would have been testing the wrong file. So with the directory prepended you would have: my @sorted_files_in_directory = sort { (stat "$directory_name/$

Re: Sorting files in a directory, without using any OS specific command, ordered by modified timestamp

2010-12-01 Thread John W. Krahn
Amit Saxena wrote: Hi all, Hello, The following perl program, for sorting files in a directory, without using any OS specific command, ordered by modified timestamp is not working. Please help. *Perl Program* #!perl.exe use strict; use warnings; my $directory_name; print "This pr

Re: Sorting files in a directory, without using any OS specific command, ordered by modified timestamp

2010-12-01 Thread Shawn H Corey
On 10-12-01 07:19 AM, Amit Saxena wrote: print "Sorted listing of files in<$directory_name> directory are as follows :-\n"; my $j; foreach $j ( @files_in_directory ) foreach $j ( @sorted_files_in_directory ) { print $j . "\n"; } print "\n"; -

Sorting files in a directory, without using any OS specific command, ordered by modified timestamp

2010-12-01 Thread Amit Saxena
Hi all, The following perl program, for sorting files in a directory, without using any OS specific command, ordered by modified timestamp is not working. Please help. *Perl Program* #!perl.exe use strict; use warnings; my $directory_name; print "This program print the files in asce

Re: Directory Size

2010-10-28 Thread John W. Krahn
files? Meaning once we open/read a directory is to calculate the total, in MB's, the size of the files in a particular directory folder. You could make use of File::Find's find function along with stat. =pod Example use strict; use warnings; use File::Find; my $size; my $directory =

Re: Directory Size

2010-10-28 Thread Alan Haggai Alavi
iles? Meaning > once we open/read a directory is to calculate the total, in MB's, the size > of the files in a particular directory folder. > > Thanks, > > > Mike(mickalo)Blezien > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Re: Directory Size

2010-10-27 Thread Mike Blezien
- Original Message - From: "Alan Haggai Alavi" To: ; "Mike Blezien" Sent: Wednesday, October 27, 2010 8:13 PM Subject: Re: Directory Size On Thursday 28 Oct 2010 06:30:01 Mike Blezien wrote: Hello, I've been out of the programming game for a while and re

Re: Directory Size

2010-10-27 Thread Mike Blezien
- Original Message - From: "Owen" To: "Mike Blezien" Cc: "Perl List" Sent: Wednesday, October 27, 2010 8:17 PM Subject: Re: Directory Size Hello, I've been out of the programming game for a while and recently got back into some small programmin

Re: Directory Size

2010-10-27 Thread Owen
> Hello, > > I've been out of the programming game for a while and recently got > back into > some small programming projects. Just need to figure out if there is a > Perl > function to determine the total size of a folder and files? Meaning > once we > open/read

Directory Size

2010-10-27 Thread Mike Blezien
Hello, I've been out of the programming game for a while and recently got back into some small programming projects. Just need to figure out if there is a Perl function to determine the total size of a folder and files? Meaning once we open/read a directory is to calculate the total, in

Re: checking a directory in a remote system using perl

2010-07-16 Thread C.DeRykus
On Jul 14, 7:16 am, soorajspadmanab...@gmail.com (Sooraj S) wrote: >  Hi I am very new to perl. I want to login to a remote machine and > check a directory exists or not. > > my code: > > > using Net::Telnet; > > $t = new Net::Telnet(); > $t->open($remo

Re: checking a directory in a remote system using perl

2010-07-15 Thread Chas. Owens
you are running shell commands in the telnet connection, not Perl. So, to find out if a directory exists you can say test -d directory_name; echo $? which will print 0 (if the directory exists) or 1 (if it doesn't). The cmd method will return whatever output is printed by the shell command.

Re: checking a directory in a remote system using perl

2010-07-15 Thread Jim Gibson
> Hi, > Thanks for your reply. Actually i need to login to a remote machine > and do some series of steps including creating,editing and taring some > files and executing some other scripts..The remote machine is in our > local network itself..so there is no security issues and thats why i > am us

Re: checking a directory in a remote system using perl

2010-07-15 Thread Sooraj S
On Jul 15, 4:57 am, chas.ow...@gmail.com ("Chas. Owens") wrote: > On Wed, Jul 14, 2010 at 10:16, Sooraj S wrote: > >  Hi I am very new to perl. I want to login to a remote machine and > > check a directory exists or not. > > > my code: > > >

Re: checking a directory in a remote system using perl

2010-07-14 Thread Chas. Owens
On Wed, Jul 14, 2010 at 10:16, Sooraj S wrote: >  Hi I am very new to perl. I want to login to a remote machine and > check a directory exists or not. > > my code: > > > using Net::Telnet; > > $t = new Net::Telnet(); > $t->open($remote_system); > $t-&g

checking a directory in a remote system using perl

2010-07-14 Thread Sooraj S
Hi I am very new to perl. I want to login to a remote machine and check a directory exists or not. my code: using Net::Telnet; $t = new Net::Telnet(); $t->open($remote_system); $t->login($username, $passwd); # this doesnot work. if (-d $my_dir) { print "ready to go&quo

Re: get acl's of directory

2010-06-08 Thread Eric Veith1
"Chas. Owens" wrote on 06/08/2010 02:00:28 PM: > On Wed, Apr 28, 2010 at 01:52, Andreas Moroder > wrote: > snip > > "Can't build and link to 'attr'" > > > > Does anyone know what causes this error ? > snip > > My first bet is that you don't have a C compiler installed, but I > really can't tell u

Re: get acl's of directory

2010-06-08 Thread Eric Veith1
Andreas Moroder > > > Hello, > > >> > > >> is it possible to get the acl entrie of a directory on linux with perl ? > > >> > > >> Thanks > > >> Andreas > > > > > > What do you mean by "acl"? Access C

Re: get acl's of directory

2010-06-08 Thread Prasaad Kulkarni
nfsv4 supports acl in linux. getacls and facls can be look out for. On Tue, Jun 8, 2010 at 5:26 PM, Chas. Owens wrote: > On Tue, Jun 1, 2010 at 17:20, Jenda Krynicky wrote: > > From: Andreas Moroder > > Hello, > >> > >> is it possible to get

Re: get acl's of directory

2010-06-08 Thread Chas. Owens
On Wed, Apr 28, 2010 at 01:52, Andreas Moroder wrote: snip > "Can't build and link to 'attr'" > > Does anyone know what causes this error ? snip My first bet is that you don't have a C compiler installed, but I really can't tell unless you post the output of make. -- Chas. Owens wonkden.net The

Re: get acl's of directory

2010-06-08 Thread Chas. Owens
On Tue, Jun 1, 2010 at 17:20, Jenda Krynicky wrote: > From:                   Andreas Moroder >  Hello, >> >> is it possible to get the acl entrie of a directory on linux with perl ? >> >> Thanks >> Andreas > > What do you mean by "acl"? Acces

Re: get acl's of directory

2010-06-01 Thread Jenda Krynicky
From: Andreas Moroder Hello, > > is it possible to get the acl entrie of a directory on linux with perl ? > > Thanks > Andreas What do you mean by "acl"? Access Control List? There is no such thing under Linux, the permissions system works different

Re: How to move a directory to another location on the same filesystem/volume?

2010-05-23 Thread Chap Harrison
ieve I'm having such a hard time with this. I just want a >> platform-independent way of copying a directory 'A' and its contents into >> another directory 'B' (as a subdirectory of B, named A). Not crossing >> filesystems or devices. > > If you

Re: How to move a directory to another location on the same filesystem/volume?

2010-05-23 Thread Shlomi Fish
Hi Chap, On Monday 24 May 2010 04:09:52 Chap Harrison wrote: > Hi, > > I can't believe I'm having such a hard time with this. I just want a > platform-independent way of copying a directory 'A' and its contents into > another directory 'B' (as

Re: How to move a directory to another location on the same filesystem/volume?

2010-05-23 Thread Owen
On Sun, 23 May 2010 20:09:52 -0500 Chap Harrison wrote: > Hi, > > I can't believe I'm having such a hard time with this. I just want a > platform-independent way of copying a directory 'A' and its contents > into another directory 'B' (as a

How to move a directory to another location on the same filesystem/volume?

2010-05-23 Thread Chap Harrison
Hi, I can't believe I'm having such a hard time with this. I just want a platform-independent way of copying a directory 'A' and its contents into another directory 'B' (as a subdirectory of B, named A). Not crossing filesystems or devices. Various onl

AW: Directory sizes

2010-05-05 Thread HACKER Nora
Hi Thomas, > For one thing, you're using just "du" to call the binary, so we can't > be sure you're calling the same "du" in each case. So, when logged in > on the remote machine, do "which du" and use the resulting fully > qualified path in your rexec call. Check, this is ok - locally an remotel

AW: Directory sizes

2010-05-04 Thread Thomas Bätzler
HACKER Nora asked: > Unfortunately, this does not explain the difference between the local > du and the one via rexec on a remote machine. Any help appreciated. When you're getting different results then you're doing something differently ;-) For one thing, you're using just "du" to call the bi

WG: Directory sizes

2010-05-04 Thread HACKER Nora
t $1 }\'' > ); > > to get the size of a certain directory from another machine. In my test > case, this results to 72KB. This is still unsolved ... > What's even more interesting, the du (Filesys::DiskUsage) says the > directory has a local

Directory sizes

2010-05-04 Thread HACKER Nora
Hi list, Maybe someone can help me with this, I have two strange directory size calculating issues: I do a my ( $rc2, $backupsizetrans ) = rexec( $backuphost, 'du -k ' . "$backu

Re: get acl's of directory

2010-04-27 Thread Andreas Moroder
Andreas Moroder schrieb: Hello, is it possible to get the acl entrie of a directory on linux with perl ? Thanks Andreas Hello, probably I have found the module I need, it is File-ExtAttr but I when i start perl Makefile.pl I get this error "Can't build and link to 'attr'

Re: get path to linked directory

2010-04-27 Thread Shawn H Corey
Andreas Moroder wrote: Hello, I have a entry in my directory that is a soft-link to another directory. Is there a way in perl to get, starting from the link, the path of the real directory ? Thanks Andreas See: perldoc -f readlink http://perldoc.perl.org/functions/readlink.html perldoc

AW: get path to linked directory

2010-04-27 Thread Thomas Bätzler
Andreas Moroder asked: > I have a entry in my directory that is a soft-link to another > directory. > Is there a way in perl to get, starting from the link, the path of the > real directory ? http://perldoc.perl.org/Cwd.html#abs_path-and-friends HTH, Thomas -- To unsubscribe, e-mai

get path to linked directory

2010-04-27 Thread Andreas Moroder
Hello, I have a entry in my directory that is a soft-link to another directory. Is there a way in perl to get, starting from the link, the path of the real directory ? Thanks Andreas -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h

get acl's of directory

2010-04-27 Thread Andreas Moroder
Hello, is it possible to get the acl entrie of a directory on linux with perl ? Thanks Andreas -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: File::Find and top level directory

2010-04-25 Thread Shlomi Fish
On Saturday 24 Apr 2010 22:00:56 Harry Putnam wrote: > When using File::Find; > Is there any built in way to know when you are in the top level of one > of the directories in @directories? > > I mean besides grepping $File::Find::dir. > > I know that give the current directo

File::Find and top level directory

2010-04-24 Thread Harry Putnam
When using File::Find; Is there any built in way to know when you are in the top level of one of the directories in @directories? I mean besides grepping $File::Find::dir. I know that give the current directory name and of course the top directory could be massages out with something like

Re: Permission mode of a directory

2010-04-06 Thread Dr.Ruud
John W. Krahn wrote: Dr.Ruud: Akhthar Parvez K: Didn't know that Perl only deals with decimal numbers. Wherever did you get that idea? I think I might have mentioned that. :-) I see that you mentioned "That is because perl only deals with decimal numbers.". Out of context that looks

Re: Permission mode of a directory

2010-04-05 Thread John W. Krahn
Dr.Ruud wrote: Akhthar Parvez K wrote: Didn't know that Perl only deals with decimal numbers. Wherever did you get that idea? I think I might have mentioned that. :-) John -- The programmer is fighting against the two most destructive forces in the universe: entropy and human stupidity.

Re: Permission mode of a directory

2010-04-05 Thread Dr.Ruud
Akhthar Parvez K wrote: Didn't know that Perl only deals with decimal numbers. Wherever did you get that idea? -- Ruud -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Permission mode of a directory

2010-04-03 Thread Akhthar Parvez K
r Parvez K http://Tips.SysAdminGUIDE.COM UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity - Dennie Richie On Saturday 03 Apr 2010, John W. Krahn wrote: > Akhthar Parvez K wrote: > > Hi all, > > Hello, > > > I have bee

  1   2   3   4   5   6   7   8   9   10   >