Oh, you are writing a real file. And making new AJAX requests every time to download the complete file; you might have said so. And replacing the entire file each time, not writing "1,2,3,..."
That fseek does nothing, delete it; you start over at the beginning of the file every time you re-open it anyway.
Make sure your logic's working. I think there might be precedence problems in
, make it
...and make sure that j ever gets incremented at all. You could test your server-side code by opening the file for append instead of overwrite, and doing fprintf(file, "%d\n", j); so that it adds numbers line by line. If it works right the .txt should contain the numbers in sequence by the end.
Last edited by Corona688; 06-04-2010 at 01:09 PM..
yes I tried that, it do print 1,2...100.....No problem in logic.....rather I also put sleep(1); and the progress bar increments after 1 sec till 100, but this happens after the file has actually being copied. So, seems there is some buffering issue.
---------- Post updated at 01:29 PM ---------- Previous update was at 01:25 PM ----------
Now I was following a different approach. I am using a CGI which outputs
system ("ls -la /tmp/lighttpd-upload* | awk {'print $5'} | wc -l");
and my ajax reads something like this 0,1,2,3.....22,23(=MAX),22,....2,1,0 (depending on the file size). However, this is not an efficient way as MAX couldn't be known beforehand so progress bar couldn't be incremented appropriately. Therefore, I like the previous approach, but that is not working at all.Do you have any other idea??
I really appreciate your help.
I am not familiar with lighttpd, but it does a lot of I/O tricks to keep performance low, that'd be the place to start looking. Try and disable caching/optimization for certain files or folders.
Hello Guys, How all are doing?
I have an issue in Unix and want help from all of you
I have a file in UNIX which it read by line by line , If at the end of line '0' is written the it should fetch that line into another file and change '0' to '1'
and If at the end of line '1' is written then it... (10 Replies)
I have got a file in following format:
AAAAAAA
BBBBBBBB
CCCCCCC
DDDDDDD
I am trying to read this file and out put it in following format:
AAAAAAA,BBBBBBB,CCCCCCC,DDDDDD
Preferred method is shell or Perl.
Any help appreciated. (11 Replies)
Hi Unix Gurus,
I need to grep for a block that is between a start and end keyword and then in between I need to find and replace a keyword.
for eg: I need to search between Test = 000; and Test = 000; and find K9 and replace with M9
INPUT FILE
Define {
Replace = K9;
Test =... (6 Replies)
I have a process running on two hosts in Active/Standby mode. Process running on active machine is handling the traffic while process running on Standby machine is sitting idle.
We have a debugging mechanism in which logs are generated on local machine. When logging is enabled then process running... (1 Reply)
Hi,
We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Hi Folks,
I would like to monitor multipath IO on solaris for write and read operations.
Does "sar -d" include multipath IO information along with other block devices ?
Thanks,
Faizan. (0 Replies)
Hi All,
I need information on file handling in UNIX enviornment.
If in UNIX enviornment I have two process..
P1
P2
Both accessing the same file simultaneosuly(read operation)..
Suppose P1 opened the file in read mode first and started reading the file..
Then P2 opens the same file in... (5 Replies)
I have tried to show the file name whose size is greater than 200 byte in current directory.
Please help me.
ls -l | tr -s " " " " | cut -f 5,9 -d " " >out.txt
#set -a x `cat out.txt`
i=0
`cat out.txt` | while
do
read x
echo $x
#re=200
j=0
if }" < "200" ]
then
echo $j
j=`expr $j... (2 Replies)