How can i delete the last 48 bytes in a file ?

I have a file where i would like to delete the only last 48 bytes. I have not heard of any function or class where i can implement such a thing. Please help me out here !

here's my C Code:
But my remove and rename methods are not working !!
void deleteStudentRecord()
     int enrollNo;
     int counter=0;
     FILE *ptr2 = fopen("c:\\file2.txt","a");
     int records = getNoOfRecords();
     refresh();
     fflush(stdin);
     printf("Enter Enrollment Number:\n");
     scanf("%d",&enrollNo);
     while(counter!=records)
          fread(&var,sizeof(struct student),1,ptr);
          if(var.enrollNo==enrollNo)
          else
               fwrite(&var,sizeof(struct student),1,ptr2);
          counter++;
     fcloseall();
     remove("c:\\file.txt");
     rename("c:\\file2.txt","c:\\file.txt");
     printf("Press any key..");
     getch();
}

Similar Messages

  • How can I delete the last row of a Matrix

    Hi All,
    Does anyone know whether deleting the last row of a matrix controlled by a UDO child table gives problems? I have the strange effect that I cannot delete the very last existing row in the matrix, i.e. after updating the delete the last to-be deleted row comes back into my matrix !!
    I give you a snippet of my code (function getSelectedRow gives the selected row in the matrix):
    ==
    if (evnt.ItemUID.Equals(ViewConstants.Items.DELETEBUTTON))
      if (evnt.EventType == BoEventTypes.et_ITEM_PRESSED)
        if (evnt.BeforeAction)
          form = BusinessOne.Application.Forms.Item(formUID);
          mtx = (Matrix)form.Items.Item(ViewConstants.Items.MATRIX).Specific;
         int numRow = getSelectedRow(mtx);
         if (numRow != -1)
                                            mtx.DeleteRow(numRow);
                                            form.Mode = BoFormMode.fm_UPDATE_MODE;
                                       Item btn = (Item)form.Items.Item(ViewConstants.Items.ADDBUTTON);
                                       btn.Enabled = true;
    ==
    Cheers,
    Marcel Peek
    Alpha One
    Message was edited by: Marcel Peek
    Message was edited by: Marcel Peek

    Yes, there is a problem to delete the last row.
    It is fixed in version 2005.

  • How can I set the last mod of a file

    I get the last mod of a file (advanced file I/O palette -> File/Directory info)
    My problem is, that I download some files from a FTP-Server and the last mod of the downloaded file is not the same as on the ftp-server (the local file has always the time stamp from the downloaded date/time).
    I can list the timestamp from the files on the ftp-server, now I wanna change the last mod from my local file in the same as on the ftp-server.
    How can I make this?
    Thanks
    Regards
    Thomas
    Solved!
    Go to Solution.

    Hello TheDharmaInitiative,
    The "last modified" Attribute of a file can be altered programmatically using Windows API Functions.
    For LabVIEW i found a Post in a external Forum with some Sourcecode attached:
    http://www.labviewforum.de/index.php?s=c221d30094bfb9bd1edf87094f851b7f&showtopic=5895&st=0&p=28501&...
    For VB a Sourcecode Example can be found here:
    http://www.vbmonster.com/Uwe/Forum.aspx/vb/31547/Setting-a-file-s-timestamp
    To change the "last modified" Attribute manually a lot of Freeware and Open Source Tools are available:
    http://www.codeproject.com/KB/files/timestamp.aspx
    Regards
    Moritz M.

  • How can i delete the new feature "get in contact with your favourite persons"?? When u press the "home" button twice, theres a list on top of the ipad with the last persons youve been in contact with. How do i delete that, or some of them ;-)

    How can i delete the new feature "get in contact with your favourite persons"?? When u press the "home" button twice, theres a list on top of the ipad with the last persons youve been in contact with. How do i delete that, or some of them ;-) Sorry for the danish  

    You can turn that feature off in Settings>Mail, contacts, calendars>Contacts>Show in App Switcher>Recents>Off.

  • How can I delete the guest network from my airport. It was fine until the last update. It says my whole name's guest network which I do not want everyone seeing. There is no guest network setting in my airport utility.

    How can I delete the guest network from my airport. It was not showing up until I recently upgraded the airport. It now says my name's guest network and I don't like my name showing on the available network list! I am using a Verizon wireless modem with the wireless feature off.

    Open AirPort Utility, go to the Wireless tab and remove the check from the guest network check box.

  • How do i view photos in macbook pro, and while viewing how can i delete the unwanted photos with delete button?

    1 My questions are about viewing and managing photos from a folder.
    a. How do i view photos in macbook pro - i know the space bar thingy but does not help my purpose?
    b. While viewing how can i delete the unwanted photos with delete button?
    c. How can i increase the size of the photos that i am seeing in the form of icons?

    double clicking in iPhoto will open the photo.
    The left and right arrow key will move between photos, as well as swiping on a trackpad or Apple mouse.
    See >System Preference>Trackpad or mouse  for options and tut
    While selected or in the smaller icon view hitting the Delete key will delete the pic.
    Command Z will undo the last action taken.
    Periodically you have to empty the iPhoto trash.  iPhoto drop down menu>empty trash
    Same applies for viewing pics in a Folder NOT in iphoto,  Use the up and down arrows does not work in Preview, but as you know in QuickLook (spacebar) the up and down arrows will navigate.

  • How do I delete the last photos synched from my iMac to my iPad?

    How do I delete the last photos synched from my iMac to my iPad from the iPad?  They have taken up all of my storage.

    Synced photos can only be deleted by syncing again with iTunes and deselecting all synced items.
    See:  iTunes: Syncing photos

  • How to eliminate (delete) the last blank page in the script?

    Does anyone of you know how to eliminate (delete) the last blank page that appears in the script? My story is 126 pages long but in the screenplay (the document) 127 pages appear because the last one is a blank page, how do I erase this page? Thank you.

    You can try the following:
    - pressing delete key at the end of the text at page 126
    - Check if you have the option to 'Unlock Pages' in 'Production' Menu.
    If you still face this issue, then can you please save that document to disk (File > Save To Disk) and mail us at DL-AdobeStory-support<at>adobe<dot>com, so that we can suggest a fix?

  • How can i delete the find my iphone app on my ipod if i can't remember the password to get into it.

    how can i delete the find my iphone app on my ipod if i can't remember the password to get into it. I've tried everything reset my ipad, however, it keeps telling me to delete the app. But I can't get into the device to delete the app.
    What else can I do?
    Please help!

    If the iPad was running iOS 7,  iCloud: Find My iPhone Activation Lock in iOS 7
    http://support.apple.com/kb/HT5818
    How can I unlock my iPad if I forgot the passcode?
    http://www.everymac.com/systems/apple/ipad/ipad-troubleshooting-repair-faq/ipad- how-to-unlock-open-forgot-code-passcode-password-login.html
    iOS: Device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    How can I unlock my iPad if I forgot the passcode?
    http://tinyurl.com/7ndy8tb
    How to Reset a Forgotten Password for an iOS Device
    http://www.wikihow.com/Reset-a-Forgotten-Password-for-an-iOS-Device
    Using iPhone/iPad Recovery Mode
    http://ipod.about.com/od/iphonetroubleshooting/a/Iphone-Recovery-Mode.htm
    You may have to do this several times.
    Saw this solution on another post about an iPad in a school environment. Might work on your iPad so you won't lose everything.
    ~~~~~~~~~~~~~
    ‘iPad is disabled’ fix without resetting using iTunes
    Today I met my match with an iPad that had a passcode entered too many times, resulting in it displaying the message ‘iPad is disabled – Connect to iTunes’. This was a student iPad and since they use Notability for most of their work there was a chance that her files were not all backed up to the cloud. I really wanted to just re-activate the iPad instead of totally resetting it back to our default image.
    I reached out to my PLN on Twitter and had some help from a few people through retweets and a couple of clarification tweets. I love that so many are willing to help out so quickly. Through this I also learned that I look like Lt. Riker from Star Trek (thanks @FillineMachine).
    Through some trial and error (and a little sheer luck), I was able to reactivate the iPad without loosing any data. Note, this will only work on the computer it last synced with. Here’s how:
    1. Configurator is useless in reactivating a locked iPad. You will only be able to completely reformat the iPad using Configurator. If that’s ok with you, go for it – otherwise don’t waste your time trying to figure it out.
    2. Open iTunes with the iPad disconnected.
    3. Connect the iPad to the computer and wait for it to show up in the devices section in iTunes.
    4. Click on the iPad name when it appears and you will be given the option to restore a backup or setup as a new iPad (since it is locked).
    5. Click ‘Setup as new iPad’ and then click restore.
    6. The iPad will start backing up before it does the full restore and sync. CANCEL THE BACKUP IMMEDIATELY. You do this by clicking the small x in the status window in iTunes.
    7. When the backup cancels, it immediately starts syncing – cancel this as well using the same small x in the iTunes status window.
    8. The first stage in the restore process unlocks the iPad, you are basically just cancelling out the restore process as soon as it reactivates the iPad.
    If done correctly, you will experience no data loss and the result will be a reactivated iPad. I have now tried this with about 5 iPads that were locked identically by students and each time it worked like a charm.
    ~~~~~~~~~~~~~
    Try it and good luck. You have nothing more to lose if it doesn't work for you.
     Cheers, Tom

  • I utilise Entourage for my mails. When I tip a mail adress and write a wrong one, I change. When I will send again a mail to the same adress the wrong and good one appears both.  How can I delete the wrong one

    Question is here above but more details here under
    I use Entourage as Mail sender. I don't use the adress book.
    When I tip a wrong adress  and make the correction, the old one stays in the memory of my computer ( apple I Mac ).
    When I wish to send a new message to the same adress, the wrong one appears in the same time , and some time I don't remember wich is the good one .
    To avoid that problem, how can I delete the wrong adress for future sending of mails.

    Solution, use Apple Mail
    I can highly recommend migrating to the Address Book. You won't have the typo'ed history in your email.
    Here's the KB on how to clear the list
    http://support.microsoft.com/kb/823667

  • Recently, U2 music appeared on my ipod without my requesting it or wanting it. I was able to delete all of the songs except for one. How do I delete the last one from my ipod? The song does not show up in iTunes when I plug my ipod into the computer.

    Recently, U2 music appeared on my ipod without my requesting it or wanting it. I was able to delete all of the songs except for one. How do I delete the last one from my ipod? The song does not show up in iTunes when I plug my ipod into the computer. The version installed on my ipod is 7.1.2(11D257).

    Hi donfrommars,
    Welcome to the Apple Support Communities!
    Please use the following article for information and instruction on deleting the U2 album from your devices and account.
    Remove iTunes gift album "Songs of Innocence" from your iTunes music library and purchases
    Have a great day,
    Joe

  • How can I delete the duplicates in one go, rather than individually?I consoladated my iTunes library looking for a song I bought...my whole library is now duplicated. Thousands of songs and hundredes of podcasts.

    I consolidated my iTunes library and now I have duplicates of everything, podcasts, songs, play lists...everything. How can I delete the whole set of duplicates at once. It is thousands of items I can not do them indiviually.
    Thanks

    I consolidated my iTunes library and now I have duplicates of everything, podcasts, songs, play lists...everything. How can I delete the whole set of duplicates at once. It is thousands of items I can not do them indiviually.
    Thanks

  • How can i delete the masters of iPhoto without losing my photos

    Mac Book Pro (Mid 2012) 13 inches
    256 Solid State Start up Insert in DVD Drive
    1T Hard Drive in reg slot
    16 GB Ram
    Mavericks 10.9.4
    iphoto 9.5.1
    I am currently keeping my iPhoto library on my 256 SS Main Drive of my MacBook Pro.
    How can I delete the masters of iPhoto without losing my photos in the main iPhoto display library and all their masters and edits.
    I take loads of photos and import them and then will keep only 5% of the ones that I import.  As a result I have a masters folder of over 50GB and actual photos that take up less that 5GD.  Is it possible to delete the master folder without losing all the photos and without having to pain stakingly go through every folder and pick out from literally hundreds the ones that i kept and edited.  How do I reduce the size of the masters just down to the ones that I have kept and not every single photo and video that I imported in the history of my iPhoto experience.
    If I delete the master folder will all the photos and their edits be deleted.
    If so, is there a way to just delete the masters that are no longer in the iPhoto library, while keeping the masters and edits of the ones that I clearly want to keep because they are the ones that I did keep.
    Why do they keep the masters of photos that I clearly deleted and emptied the trash on.
    I like to maximize space and this would help a lot to clear up for me.  Thank you.

    All the 5000 photos that reappeared after repair today were from my canada mega event, but for some reason it did not do it for all the other mega events.  It is a start but not complete.
    Try the rebuild to recover more lost photos.
    If "rebuild" with iPhoto does not recover more lost photos, rebuild with iPhoto Library Manager as described by Old Toad in this thread, but rebuilding with iPhoto Library manager will not recover your projects like cards, bilks, slideshows.
    Re: iPhoto glitch with retained masters https://discussions.apple.com/message/26354337#26354337
    Mostly the way I organize all my photos is that I make a folder for each country I visit.  i.e. New Zealand Folder, Canada Folder, India Folder; and at the same time, any photos that I import I delete directly from new imports and just keep the ones i want and then i go up to events and move the latest imported event into a mega event for that country and so they all get joined in a sense.
    As a workaround, merge the events right after importing, before you start deleting photos.  And empty the trash always before merging projects.
    You might consider to use albums instead of events for your country lists.   I simply use the events as basic containers. One event for each day of shooting photos. I found, that smart albums and searches are quicker in iPhoto and Aperture, if the events are smaller, also browsing is easier, if the events are not so large.
    You can merge albums and remove photos from albums without the problems mentioned above.

  • I want to update iCloud account with new apple id but don't know password for old apple id.  Plus can no longer receive email at old apple id.  How can I delete the current iCloud account on my iPhone if the previously stated conditions exist?

    I want to update iCloud account with new apple id but don't know password for old apple id.  Plus can no longer receive email at old apple id.  How can I delete the current iCloud account on my iPhone if the previously stated conditions exist?

    If the old ID is yours, and if it is an earlier version of your current ID, go to https://appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Click edit next to the primary email account, change it back to your old email address and save the change.  Then edit the name of the account to change it back to your old email address.  You can now use your current password to turn off Find My iDevice, even though it prompts you for the password for your old account ID. Then save any photo stream photos that you wish to keep to your camera roll.  When finished go to Settings>iCloud, tap Delete Account and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https://appleid.apple.com and change your primary email address and iCloud ID name back to the way it was.  Now you can go to Settings>iCloud and sign in with your current iCloud ID and password.

  • I have two apple id's because my hotmail account is no longer active. How can I delete the old one and use or update the new one?  Every time I try it won't allow me and now my iPad thinks there are two accounts and they are arguing with each other. Help!

    I have two apple id's because my hotmail account is no longer active. How can I delete the old one and use or update the new one?  Every time I try it won't allow me and now my iPad thinks there are two accounts and they are arguing with each other. Help!

    You can't merge accounts or copy content to a different account, so anything that you bought or downloaded via the old account is tied to that account - so any updates that those apps get you will only be able to download via that account. You can change which account is logged in on the iPad via Settings > Store

Maybe you are looking for

  • How can I send a 10g report direct to the printer?

    Hi! I've got a form that calls n-times then same report, with different parameters. Actually, I generate a pdf and then, the user could print it.... but it is not a good idea, I want to send the output direct to the printer. do I have to register the

  • (Missing) Apple Firewire 720x...on FCP3

    accidentally having turned off the power, we now get the error above. how does one put it back in? are there a couple ways to go about it, one being the best? thanks a million. g4   Mac OS X (10.3)  

  • How can i freeze date in date picker.

    Dear All i want to freeze date in date picker which are  less then system date . How can i freeze date in date picker. Thanks

  • Step for oracle database storage migration

    Hi all Need a help for database storage migration from old storage to new storage. Please advise and given step to migrate the database storage. Database version: 9i,10g(ASM),10g and 11g (ASM)

  • Critical Errror:-An application fault occurred.....

    HI,    I am getting this Error An application fault occurred: ('screen/not_found.py __call__|28', "<type 'exceptions.AttributeError'>", "Bean instance has no attribute '__getitem__'", '[util/Aquarium.py screenLoop|407] [util/InternalLibrary.py invers