Dear Group, I'm a beginner in PHP and would like to know how do I use 'fopen()' to write to files, because of some wierd reason I have to set some flag because...
I've got a bunch (thousands) of files in a structure like this: /somedir/traces/2004/08/03/abc/longfilename.abi and I need to move them to another directory...
Paul Archer
tigger@...
Aug 3, 2004 7:25 pm
19340
... Paul> So the question is: is there a module/script whatever out there Paul> that would help with this? I'd rather not have to write a Paul> solution from...
... rsync will do what you need (run the following from /somedir/traces): rsync -vur . /data/traces The command-line switches are v=verbose, u=update,...
... Maybe you misunderstood me. ... I've got a bunch (thousands) of files in a structure like this: /somedir/traces/2004/08/03/abc/longfilename.abi and I need...
Paul Archer
tigger@...
Aug 3, 2004 9:08 pm
19343
... How about 4 lines? cd /somedir/traces tar cf /tmp/somefile.tar * cd /data/traces tar xf /tmp/somefile.tar This will overwrite stuff with the same name, but...
Jeff Eggen
jeggen@...
Aug 3, 2004 9:24 pm
19344
... Thanks for the suggestion. It's close, but unfortunately, I can't copy the files and then delete the originals (I don't have the space--the files are about...
Paul Archer
tigger@...
Aug 3, 2004 9:25 pm
19345
... As I mentioned in another post, my problem is that due to the sheer volume of the data 3/4 of a terabyte or so, I simply can't do anything that copies then...
Paul Archer
tigger@...
Aug 3, 2004 9:27 pm
19346
... Paul> Now, it may be that there's a simple solution. It may be that Paul> I'm being lazy ("beyond reproach", even) for asking for help Paul> rather than...
... Couldn't you do: use File::Basename 'fileparse'; use File::Path 'mkpath'; for (@list_of_files) { my ($file, $path) = fileparse($_); (my $new_path = $path)...
... Then the move suggestion should work for you. They didn't all involve copying. cd /somedir/traces for i in `find . -print | sort` do ([ -d $i ] && [ -x...
Jeff Eggen
jeggen@...
Aug 3, 2004 10:42 pm
19349
Hi! I am new to perl and CGI. I am even not sure that this is more perl or CGI problem. I am trying to use CSV module by Christopher Rath ...
... So, it seems that CSVvalidate() is failing. One possibility - the input file was uploaded by ftp as binary instead of ascii? It might make (though...
Hello! Bull's-eye! I re-uploaded the file in text mode and it is working. Does it have something to do with CR/LF conversion? Thanks a lot for the hint! Btw,...
... I've seen you slap other people down before. I've even been guilty of following suit. Glad it's happened to me now, so I know what it feels like, and I can...
Paul Archer
tigger@...
Aug 4, 2004 2:15 pm
19353
I had no idea the mkpath subroutine was out there. I ended up doing a system ("mkdir", "-p", "$dir") but next time I'll definitely use mkpath instead. Thanks...
Paul Archer
tigger@...
Aug 4, 2004 2:18 pm
19354
... Thanks for the code. I ended up doing it in Perl, but it's always nice to see how different people handle the same task. ... You are quite right. I should...
Paul Archer
tigger@...
Aug 4, 2004 2:22 pm
19355
... Paul> FWIW, I did word my original post poorly, and left out some important Paul> details--like the fact that I was looking for hints, And I gave you those...
Hi, supposing I've got a string like the following: a.b.c.d.e.f and that I'd like to keep only the first characters before the first '.' (e.g., 'a'), why the...
Luca Ferrari
fluca1978@...
Aug 5, 2004 12:15 pm
19358
... untested - but try :- $string =~ s/^(.+?)\.(.*)/$1/; you get 'f' because F still precedes a . (dot)... put the ? in, to restrict it to the first match (or...
Gordon Stewart
gordonisnz@...
Aug 5, 2004 12:27 pm
19359
Hi Luca, I'm not sure if I get the requirement. If you wish to _retain_ the one character before the initial period, this is how I would do it: chomp (my...
I think this code should work... #------------------------------------ my ($a, $b); $a = "a.b.c.d.e.f."; ($b) = split(/\./,$a); print $b, "\n"; ...
JORGE SILVA
jorge.reissilva@...
Aug 5, 2004 12:44 pm
19361
the info to the file is written like this axe,sox,dog,fox, can I read this from the file as an array? @A=<FileName>; I am also looking for info on homemade...
Perl's + and * Quantifiers are greedy. In other words, they grab everything from the beginning of the line on through the end. I wrote a Regex primer a while...
Brad Lhotsky
brad@...
Aug 5, 2004 2:04 pm
19363
For some reason, my initial reading of this post was the first two characters before the first '.'. Weird. Anyways, ignore my other code, do this: my $match =...
Brad Lhotsky
brad@...
Aug 5, 2004 2:07 pm
19364
On Thursday 05 August 2004 15:49 Luinrandir Hernsen's cat walking on the ... You can surely convert into an array: $line = <FILENAME>; @A = split(",",$line); ...
Luca Ferrari
fluca1978@...
Aug 5, 2004 2:13 pm
19365
On Thursday 05 August 2004 13:41 Luca Ferrari's cat walking on the keyboard ... Hi guys, thanks everybody for the help. The solution I adopted is $string =~...