Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cannot delete file after copied from cd! - help! 1

Status
Not open for further replies.

redzombi19

Programmer
Jun 2, 2002
35
0
0
US
hi i am pretty sure the reason is because it is copied from the cd as read only, but i was wondering if there was a way to remove the read only attribute in code on anything like that??????

Thanks!
 
Yes, anything you copy from a CD is read only. Here's how you remove that flag:
Code:
lcFileName = "MyFileName"
declare integer GetFileAttributes in Win32Api string lcFileName
declare SetFileAttributes in Win32Api string lcFileName, integer lnAttributes
lnAttributes = GetFileAttributes(lcFileName)
lnAttributes = BitAnd(m.lnAttributes,0)
SetFileAttributes(lcFileName,m.lnAttributes)



-BP
 
Thanks A Bunch, BPeisch it worked that was exactly what i needed!
 
Hi Barbara,
Could you tell how to set reset other flags as well ?
-Bart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top