seek

Deleting a line from a huge file in Perl

扶醉桌前 提交于 2019-11-27 04:01:15
问题 I have huge text file and first five lines of it reads as below : This is fist line This is second line This is third line This is fourth line This is fifth line Now, I want to write something at a random position of the third line of that file which will replace the characters in that line by the new string I am writing. I am able to achieve that with the below code : use strict; use warnings; my @pos = (0); open my $fh, "+<", "text.txt"; while(<$fh) { push @pos, tell($fh); } seek $fh , $pos

seek to a point in html5 video

穿精又带淫゛_ 提交于 2019-11-27 03:02:48
问题 Is it possible to seek to a particular point in html5 video displayed in a web page? I mean ,can I input a particular time value (say 01:20:30:045 ) and have the player control (slider) move to that point and play from that point onwards? In older version of mozilla vlcplugin I think this is possible by seek(seconds,is_relative) method..but I would like to know if this is possible in html video. Edit: I created the page with video and added javascript as below.When I click on the link ,it

Stream wrapper to make Stream seekable?

大憨熊 提交于 2019-11-26 22:53:58
问题 I have a readonly System.IO.Stream implementation that is not seekable (and its Position always returns 0). I need to send it to a consumer that does some Seek operations (aka, sets the Position) on the stream. It's not a huge seek -- say +/- 100 from the current position. Is there an existing Stream wrapper that will add a buffering ability to the stream for simple Seek operations? Update: I should add that my consumer is the NAudio Mp3FileReader. I really just need a way to play a (slowly

Safe to have multiple processes writing to the same file at the same time? [CentOs 6, ext4]

血红的双手。 提交于 2019-11-26 15:18:22
问题 I'm building a system where multiple slave processes are communicating via unix domain sockets, and they are writing to the same file at the same time. I have never studied filesystems or this specific filesystem (ext4), but it feels like there might be some danger here. Each process writes to a disjoint subset of the output file (ie, there is no overlap in the blocks being written). For example, P1 writes to only the first 50% of the file and P2 writes only to the second 50%. Or perhaps P1

iOS Audio Trimming

孤街浪徒 提交于 2019-11-26 09:25:47
问题 I searched a lot and couldn\'t find anything relevant... I am working on iOS audio files and here is what I want to do... Record Audio and Save Clip (Checked, I did this using AVAudioRecorder ) Change the pitch (Checked, Did this using Dirac) Trimming :( I have two markers i.e. starting & ending offset and using this info I want to trim recorded file and want to save it back. I don\'t want to use \"seek\" because later on I want to play all recorded files in sync (just like flash movie clips