File size and deleting some content out of that...

Dear All,
I have a log file...using FileWriter, I am updating that file...Once if the log file's content reaches certain limit(some 1000 lines), I want to delete the first 100 lines...how to do this...any suggestions/codes please...
bye & waiting for ur post,
Sakthivel S.

Guessing here, but (I guess) your program will write to the file quite a few times during its operation.
If you write a LogWriter class that you send the log entries to then when it reaches 1000 lines it will have to re-write then whole file, omitting the first line and appending the last line every time you add another log entry.
this would put a lot of strain on the file system and slow you program down a lot.
I would look for a different way to store and access the log data.
1 way is to store all the log file entires in a vector of strings and only write the file when you want to read it.
LogWriter would then only have to remove the first line and add the latest line, also when instructed write the vector to the log file.
Another way would be to just write all the data to the file, then when you want to read it you could read all the lines back (keeping only the last 1000 as per method 1) and then rewrite the file
dont worry too much about storing this "large" amont of data in avector, you should have plenty of memory for that

Similar Messages

  • I keep getting a "Not enough storage to back-up my device" message since I upgraded to the new software. Short of purchasing more memory, and deleting some content, are there any other options?

    What are my options for increasing storage capacity besides purchasing more memory, or deleting existing content. The new software install used up much of my storage capacity and the message is driving me crazy. Any ideas?? Thanks!

    There are two kinds of storage messages that appewr on iOS devices. Your question seems at odds with your description so there might be some confusion here.
    If the storage refers to not enough for an icloud back up then you need to purchase more icloud space or turn off iCloud backup. You can backup using iTunes on your computer with paying for additional iCloud storage.
    if the storage refers to that on your iOS device as in there is not enough storage to update, then you have two options and neither option involves adding more storage since the amount of storage on an iOS devoce is fixed. One option is to delete stuff from your device to free up more space. The second option is to complete the update while your devoce is connected to your computer running the latest version of iTunes. When you do that the update is downloaded to your computer and extracted there so it doesn't require as much free space on your iOS device.

  • HT4847 On startup my macbookair says start up disk full/delete some files. When I look at storage disk utility I see 51GB of a possible 60GB is used with Other. What is Other? and how can I view and delete some of these files?

    On startup my macbookair says start up disk full/delete some files. When I look at storage disk utility I see 51GB of a possible 60GB is used with Other. What is Other? and how can I view and delete some of these files?

    A MacBook will use Time Machine to make local backups so that when connected to an external drive it will backup a lot faster.
    to disable this, you must use a command under terminal.
    to locate terminal, do a search for it under spotlight (the magnifying glass on the top right corner), should be the first hit.
    once under terminal, type the following text exactly:
    sudo tmutil disablelocal
    hit enter.
    you will be asked to input your password, if you do not have a password, you will have to create one before performing this command. after entering your password, hit enter again and close terminal.
    in a few minutes the space taken up by time machine should be cleared.

  • Two step import, downsizing image file sizes and/or keeping copies?

    hi all,
    leonie was kind enough on another thread to suggest a two step import from the iphone in order to make sure that there is no accidental deletion or data loss. my understanding (i'm repeating it here myself in case i am misunderstanding) is that this routine involves 1. importing images into Aperture via the conventional import method and then 2. backing up to iTunes (to save the images) and 3. verifying (visually i think) that the images are in the Aperture database and then if so allow Aperture to delete all the images from the iPhone.
    this seems to make sense to me but i realized i had a couple of questions about general "photo hygiene" related to this kind of thing.
    1. is there some way to downsize file size after images are imported into Aperture? i take a ton of photos and only some are important to keep at a high resolution and i feel like i am stuck between having a huge Aperture database cluttered with lots of photos at high resolution /or/ turning down the file size and finding that i have an important image that is at a low resolution because i forgot to turn up the file size (i think these are in settings somewhere in my phone) before i took the photo or only realized later that it was important to have this image at higher resolution. if i could downsize while thinking about it in Aperture this seems like it would work.
    2. does anyone keep an external copy of their images outside of the Aperture database?
    thanks

    hi terence,
    thank you.
    so can i ask if anyone is using an iphone and/or what setting(s) and/or resolution folks are using?
    i guess i have a bit of a dilemma in that i take a ton of photos and i only use one at a high resolution while the others can be something as insignificant as a visual note to myself. and it kind of kills me that these could be 1.2 MB in that i have a lot of them. i sort of wish there was a way to downsample imagery since a lot of these are not so important.
    anyway. yeah i guess i was wondering if folks do a referenced library or keep an extra copy as a backup (i guess i am 'embedding' images in the library but i forget what i call this in aperture) - and i have started to wonder if there is some utility to doing a referenced library or keeping a backup but this seems like overkill while at the same time a referenced library would allow me the ability to downsample images from what i can tell but i am just guessing here since i haven't tried this method.
    thanks.

  • My MacBook Pro HD Storage Capacity is getting full with majority of usage classified as Other (126.77GB). What is included as Other and how can I edit and delete unnecessary content?

    The Storage capacity on my MacBook Pro (Mid 2010, Version 10.10, 4 GB Memory) is getting full. It appears I only have 29.04 GB free of 319.21 GB. The majority of usage is classified as "Other" (126.77 GB) and "Movies" (106.05 GB).  I would like to edit and delete some of the Other content, but what is included in this category? How do I know what is safe to delete? I don't have many documents created. I have saved and filed content from internet sites... do these type of files use a lot of storage capacity (mostly recipes)?
    I have very few Apps and have been updating all software regularly.  Mose recent update was Yosemite.

    The Storage capacity on my MacBook Pro (Mid 2010, Version 10.10, 4 GB Memory) is getting full. It appears I only have 29.04 GB free of 319.21 GB. The majority of usage is classified as "Other" (126.77 GB) and "Movies" (106.05 GB).  I would like to edit and delete some of the Other content, but what is included in this category? How do I know what is safe to delete? I don't have many documents created. I have saved and filed content from internet sites... do these type of files use a lot of storage capacity (mostly recipes)?
    I have very few Apps and have been updating all software regularly.  Mose recent update was Yosemite.

  • Aperture Exporting JPEG's from RAW: file size and quality questions?

    Hey Everyone,
    So, I'm using Aperture 2 and I've got some questions about exporting from RAW to JPEG. I shoot with a Nikon D70 so original RAW files are 5-6mb in size. After doing some basic post processing when I export the pics at "full size" with picture quality of 11 out of 12 then the resulting JPEG is about half the file size of the original RAW file. For example a 5.6mb RAW becomes a 2.6mb JPEG. The resolution in pixels per inch and and the overall image size remain unchanged. Have I lost picture quality due to the exporting JPEG being smaller in file size?
    My friend who works with me prefers to edit in Photoshop and when he follows the same workflow his saved JPEG from the identical RAW file in Photoshop is minimally smaller in file size, say 5.6mb to 5.3mb. He's telling me that my Aperture edited photos are losing quality and resolution.
    Is he right, are my pics of lesser quality due to being a smaller file size? I've always been told that the quality of a picture is not in the mbs, but the pixel density.
    I've bee told that Aperture has a better compression engine and that the resulting files are of the exact same quality because the PPI and image size are the same. Is that what explains the much smaller file sizes in Aperture?
    I tried changing the picture quality in the export menu to 12 out of 12, but the resulting JPEG then becomes larger than the original RAW at over 7mbs.
    Can someone please help me understand this better? I don't want to lose picture quality if that is indeed what is happening.
    Thanks in advance for your help.

    mscriv wrote:
    So, I'm using Aperture 2 and I've got some questions about exporting from RAW to JPEG. I shoot with a Nikon D70 so original RAW files are 5-6mb in size. After doing some basic post processing when I export the pics at "full size" with picture quality of 11 out of 12 then the resulting JPEG is about half the file size of the original RAW file. For example a 5.6mb RAW becomes a 2.6mb JPEG. The resolution in pixels per inch and and the overall image size remain unchanged. Have I lost picture quality due to the exporting JPEG being smaller in file size?
    JPEG is a "lossy" file compression algorithm. Whether Aperture or PS, *every time a JPEG is saved some loss occurs*, albeit minimal at the 11 or 12 level of save, huge losses at low save levels. Some images (sky, straight diagonal lines, etc.) are more vulnerable to showing visible jpeg artifacts.
    My friend who works with me prefers to edit in Photoshop and when he follows the same workflow his saved JPEG from the identical RAW file in Photoshop is minimally smaller in file size, say 5.6mb to 5.3mb. He's telling me that my Aperture edited photos are losing quality and resolution.
    *Both of you are losing image data when you save to jpeg.* IMO the differences between the apps is probably just how the apps work rather than actually losing significantly more data. The real image data loss is in using JPEG at all!
    Is he right, are my pics of lesser quality due to being a smaller file size?
    I doubt it.
    I've always been told that the quality of a picture is not in the mbs, but the pixel density.
    The issue here is not how many pixels (because you are not varying that) but how much data each pixel contains. In this case once you avoid lossy JPEG the quality mostly has to do with different RAW conversion algorithms. Apple and Adobe both guess what Nikon is up to with the proprietary RAW NEF files and the results are different from ACR to Apple to Nikon. For my D2x pix I like Nikon's conversions the best (but Nikon software is hard to use), Aperture second and Adobe ACR (what Photoshop/Bridge uses) third. I 98% use Aperture.
    I tried changing the picture quality in the export menu to 12 out of 12, but the resulting JPEG then becomes larger than the original RAW at over 7mbs. Can someone please help me understand this better? I don't want to lose picture quality if that is indeed what is happening.
    JPEG is a useful format but lossy. Only use it as a _last step_ when you must save files size for some reason and are willing to accept the by-definition loss of image data to obtain smaller files (such as for web work or other on-screen viewing). Otherwise (especially for printing) save as TIFF or PSD which are non-lossy file types, but larger.
    As to the Aperture vs. ACR argument, RAW-convert the same original both ways, save as TIFF and see if your eyes/brain significantly prefer one over the other. Nikon, Canon etc. keep proprietary original image capture data algorithms secret and each individual camera's RAW conversion is different.
    HTH
    -Allen

  • I'm trying to delete some recently downloaded apps that don't work. They are faded grey and although they shake with the other apps, no cross appears in the top corner. Any ideas anyone? Thanks, Sean

    I'm trying to delete some recently downloaded apps that don't work. They are faded grey and although they shake with the other apps, no cross appears in the top corner. Any ideas anyone? Thanks, Sean

    I have the same issue witha  slight variation.  The app icons that are grayed out and cannot be deleted are DUPLICATES of other apps that I already have.  For instance I now have 2 Redbox apps - one works normally, the other cannot be opened or deleted. 

  • In Numbers, I copied a worksheet and deleted the contents. The sheet I copied from has a header, I can't see it or bring it up when I'm working but it appears when I print the sheet. How do I delete it?

    In Numbers, I copied a worksheet and deleted the contents. The sheet I copied has a header.  I can't see it or bring it up when I'm working but it appears when I print the sheet. How do I delete the header?

    Hi Cristina,
    Headers are not shown in normal view.
    Menu > File > Print to open Print View.
    Hover the cursor over the Header to see the outline. Click and delete.
    Regards,
    Ian.

  • File Sizes and Capacity

    Ive noticed low available space on my system how i do go through each folder to find ou thowmuch it contains?
    like in windowsxp [i know its a diff os..but in comparison] how owuld i see the file sizes through out each folder ?
    thank you

    an easier solution is to click that little gear icon at the top of the finder window (make sure you have nothing selected) the click "show view options" then check off "size" and "calculate all sizes" and make sure at the top that "all windows" is selected....that should do the trick
    (@work) eMac G4 1.25 GHz OS X 10.3.9 (@home) Mac Pro 2.66 GHz Intel Quad-Xeon   Mac OS X (10.4.9)  

  • Urgent:Comparing file size and file hashcode

    Hi i am developing an EJB in which I have to dynamically pick the filename,filesize and hashcode of the file.
    In case filename exists then it should check for file size and hashcode of the file. if both of these are equal then the processing should stop.
    Could anyone provide some help in comparing filesize and hashcode of the file with itself.
    Regards
    Abhi

    read the [File API|http://java.sun.com/javase/6/docs/api/java/io/File.html] .
    The file size is a long. and the hashCode is an int. [compare them - they are primitives|http://java.sun.com/docs/books/tutorial/java/nutsandbolts/operators.html]

  • Logging software - shrinking file size and keeping timecode

    I recently found and downloaded the trial version of InqScribe Transcription Software (http://www.inqscribe.com/index.html).
    It seems pretty neat. You can open up and video file in the program and it read the timecode from the file and inserts it into transcript as your typing. It says it can open ANY type of video that Quicktime can view.
    Here's my dilemma - I want my clients and producer to use this program to log footage on their PCs out and about. I"m shooting with the Sony NX5 and transcoding to Pro Res LT. Obviously these files are HUGE.
    I'd like to find a way that I can shrink the file sizes and keep the original timecode. I thought h.264 would be best. I can also shrink the resolution from 1920x1080 down to something much smaller.
    I'm looking for an end product that is compatible with PCs and Macs, around 500mbs or less, and has the original TC.

    Resize to 480x270. The data rate before compression will be 1/16 of the 1920x 1080 image. Add H.264 Quicktime compression and you'll have a small file. Verify with the company that it can read h.264 files.
    When you do the conversion use Compressor and turn off Frame Controls when you do the resizing.The encoding will go much faster.
    x

  • Resize Video, both the file size and actual size

    Hi All,
    I am very new to Adobe Premiere (CS3). I have had it for a while but not needed to use until now. A client of mine has sent me a video that he wants on his website. But it’s 150M and 1280 * 720. Can anyone help me out with how I can resize both the file size and actual size to say 800 * 450 so it can stream it via the net?
    Like I said very new to this,
    Cheers,
    Mike.

    The first thing you need to do is determine just what KIND of file you were sent, so you may start a project that matches the file
    Read Bill Hunt on a file type as WRAPPER http://forums.adobe.com/thread/440037?tstart=0
    What is a CODEC... a Primer http://forums.adobe.com/thread/546811?tstart=0
    What CODEC is INSIDE that file? http://forums.adobe.com/thread/440037?tstart=0
    I don't do streaming video, so you should search the help file... I **think** what you want out is a Flash file, but that is only after you know what you are going to load into the CS3 timeline

  • Muse trial version only has "close" for option under file menu and it's grayed out.

    Muse trial version only has "close" for option under file menu and it's grayed out.

    Some menu entries in the main menu bar are hidden if you use the mouse and only appear if you use the keyboard to open the menu (Bug 626825).
    You can see the difference if you use Alt+F to open the File menu or other menus like the Edit menu (Alt+E) and Bookmarks menu (Alt+B) and compare that to what you see if you use the mouse to open the menu after you have made the menu bar visible by tapping Alt or by pressing F10.
    Add code to userChrome.css below the @namespace line to make the hidden items appear again.
    *http://kb.mozillazine.org/userChrome.css
    *http://kb.mozillazine.org/Editing_configuration
    You can use the ChromEdit Plus or Stylish extension to have easier access to the customization files.
    *ChromEdit Plus: http://webdesigns.ms11.net/chromeditp.html
    <pre><nowiki>@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    /* Always show menu entries with class="show-only-for-keyboard" */
    #navigator-toolbox menuitem[class="show-only-for-keyboard"]{display:-moz-box!important}
    </nowiki></pre>

  • I need to export a photo at around 1meg file size,and dont seem to be able to do it in the presets can anyone help please ,I shoot on a canon 5d

    I need to export a photo at around 1meg file size,and dont seem to be able to do it in the presets can anyone help please ,I shoot on a canon 5d

    I believe Frank is referring to the end use (e.g., for print or on-screen use).
    Until he returns, I can tell you that I ran a quick test using an image from the Aperture 3 training book library which was as follows:
    Camera = Canon EOS 5D Mark II
    Master resolution = 5616 x 3744 (21 MP)
    I was able to export to a JPEG with end file size of 1 MB as follows:
    Export Presets drop-down > select 'Edit' option
    Selected preset name 'JPEG - 50% of Original Size' > change percentage value to 40% > change DPI value to '300' > click OK to set as current default > Export version to desktop.
    The exported JPEG has a resolution of 2246 x 1498 and appears on screen to have the same image quality of the original in Aperture.
    Note - I did not change the default Image Quality slider in the Export Preset dialog (which left it at 10).
    Basically, you will need to play around with the settings until you find the appropriate values to arrive at an image version you want.

  • I just got new ipad mini....I want to delete all of the music that was synced from my itunes account.  I have went through and deleted some songs one by one but some have a cloud icon with a red arrow on them.....is there a simple way just to delete them?

    I just got new ipad mini....I want to delete all of the music that was synced from my itunes account.  I have went through and deleted some songs one by one but some have a cloud icon with a red arrow on them.....is there a simple way just to delete them?

    Yes there is. Those songs are not actually on your iPad. They are in iCloud ready for download if you choose to do so. If you want to remove them go to Settings>iTunes & App Store>Show All>Music>Off. You can also do this in Settings>Music>Show All Music>Off.

Maybe you are looking for