Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

How to delete and overwrite a write-protected file?

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-25-2008, 10:08 AM
Newbie
 
Join Date: Jul 2008
Location: Hungary
Posts: 3
Default How to delete and overwrite a write-protected file?

I would like to make a copy of a file many times while a programme is running. Since this file is write-protected The first copy works but I can't owerwrite the Write-protected file at the second copying. I always receive an error message: accessing denied. The same happens when I would like to delete the file.
I tried to solve the problem like this:

FileCopy("C:\New.txt","C:\folder\New.txt",true)

Thanks!
Reply With Quote
  #2 (permalink)  
Old 07-25-2008, 10:31 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Why don't you open the original for reading and write the contents to a new file which won't then be write-protected
Reply With Quote
  #3 (permalink)  
Old 07-25-2008, 12:24 PM
Newbie
 
Join Date: Jul 2008
Location: Hungary
Posts: 3
Default

You are right because there was a txt file in the example.
Actually I would like to make a copy of all the files in a folder by means of a programme. These files are in different extension, for example: bmp, wav, ini etc. Some of them are write-protected and I can't change it.
Reply With Quote
  #4 (permalink)  
Old 07-25-2008, 04:24 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

I've added FileGetAttribute and FileSetAttribute to my FilesEx library http://www.basic4ppc.com/forum/addit...formation.html

You may find the Bitwise library useful for manipulating the attribute bit pattern.
Reply With Quote
  #5 (permalink)  
Old 07-25-2008, 05:59 PM
Newbie
 
Join Date: Jul 2008
Location: Hungary
Posts: 3
Default

Thank you! It may be the good solution but since I have used the free version for now I can't download the file. Maybe later...
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Write IF error GallyHC Questions (Windows Mobile) 4 06-02-2008 05:42 PM
Need a format to write large .dat file with numbers Stellaferox Questions (Windows Mobile) 4 02-04-2008 01:16 AM
Tip on how not to write speedy code kolbe Code Samples & Tips 1 01-30-2008 08:20 AM
Delete a row in a table and simultaneously delete it in the database gonzamax Questions (Windows Mobile) 2 12-25-2007 01:23 PM
Delete Control and Delete Form Items alfcen Basic4ppc Wishlist 3 10-05-2007 12:09 PM


All times are GMT. The time now is 10:07 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0