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...
19337
Allan Dystrup
allan_dystrup
Aug 2, 2004 5:52 pm
http://dk.php.net/fopen btw, PHP... is Hardly Perl is Hardly Perl is Hardly Perl allan dystrup...
19338
jmostert@...
jm_1983310
Aug 2, 2004 7:24 pm
LOL. Uh, yeah.. OK. I GET IT! ... This message was sent using IMP, the Internet Messaging Program....
19339
Paul Archer
tigger@...
Aug 3, 2004 7:25 pm
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...
19340
merlyn@...
merlynstoneh...
Aug 3, 2004 7:37 pm
... 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...
19341
Dave Gray
yargevad
Aug 3, 2004 7:55 pm
... 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,...
19342
Paul Archer
tigger@...
Aug 3, 2004 9:08 pm
... 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...
19343
Jeff Eggen
jeggen@...
Aug 3, 2004 9:24 pm
... 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...
19344
Paul Archer
tigger@...
Aug 3, 2004 9:25 pm
... 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...
19345
Paul Archer
tigger@...
Aug 3, 2004 9:27 pm
... 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...
19346
merlyn@...
merlynstoneh...
Aug 3, 2004 10:35 pm
... 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...
19347
Jeff 'japhy' ...
evilffej
Aug 3, 2004 10:37 pm
... Couldn't you do: use File::Basename 'fileparse39;; use File::Path 'mkpath39;; for (@list_of_files) { my ($file, $path) = fileparse($_); (my $new_path = $path)...
19348
Jeff Eggen
jeggen@...
Aug 3, 2004 10:42 pm
... 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...
19349
Irek Rybark
irekrybark
Aug 4, 2004 3:11 am
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 ...
19350
daymobrew@...
daymobrew
Aug 4, 2004 8:32 am
... 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...
19351
Irek Rybark
irekrybark
Aug 4, 2004 12:25 pm
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,...
19352
Paul Archer
tigger@...
Aug 4, 2004 2:15 pm
... 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...
19353
Paul Archer
tigger@...
Aug 4, 2004 2:18 pm
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...
19354
Paul Archer
tigger@...
Aug 4, 2004 2:22 pm
... 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...
19355
merlyn@...
merlynstoneh...
Aug 4, 2004 2:32 pm
... 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...
19356
daymobrew@...
daymobrew
Aug 5, 2004 10:10 am
... Yes ... Headers (and 'Content-type' is one) always need a blank line before the data....
19357
Luca Ferrari
fluca1978@...
Aug 5, 2004 12:15 pm
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...
19358
Gordon Stewart
gordonisnz@...
Aug 5, 2004 12:27 pm
... 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...
19359
Madani, Srikanth, VF-DE
ihaveitinme
Aug 5, 2004 12:31 pm
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...
19360
JORGE SILVA
jorge.reissilva@...
Aug 5, 2004 12:44 pm
I think this code should work... #------------------------------------ my ($a, $b); $a = "a.b.c.d.e.f."; ($b) = split(/\./,$a); print $b, "\n"; ...
19361
Luinrandir Hernsen
Luinrandir
Aug 5, 2004 1:55 pm
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...
19362
Brad Lhotsky
brad@...
Aug 5, 2004 2:04 pm
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...
19363
Brad Lhotsky
brad@...
Aug 5, 2004 2:07 pm
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 =...
19364
Luca Ferrari
fluca1978@...
Aug 5, 2004 2:13 pm
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); ...
19365
Luca Ferrari
fluca1978@...
Aug 5, 2004 2:15 pm
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 =~...