# Removing read-only files

**URL:** https://talk.remobjects.com/t/removing-read-only-files/1287
**Category:** Train
**Created:** [October 4, 2012, 7:28am UTC](https://talk.remobjects.com/t/removing-read-only-files/1287 "2012-10-04T07:28:43Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![vladk](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/v/cdc98d/32.png) [@vladk](https://talk.remobjects.com/u/vladk)
#### Post date: [October 4, 2012, 7:28am UTC](https://talk.remobjects.com/t/removing-read-only-files/1287/1 "2012-10-04T07:28:43Z")

</div>

Train seems unable to remove a read-only file neither with file.remove, nor with folder.remove(recursive).

Is that the limitation or bug? Is there any workaround or other way to do that?

Thanks,  
Vladimir Kudelin

---

<div class="post-metadata">

### Author: ![ck](https://talk.remobjects.com/user_avatar/talk.remobjects.com/ck/32/8740_2.png) [@ck](https://talk.remobjects.com/u/ck)
#### Post date: [October 4, 2012, 11:52am UTC](https://talk.remobjects.com/t/removing-read-only-files/1287/2 "2012-10-04T11:52:35Z")

</div>

execute “attrib \<FILE\_NAME\> -r” via shell, then use file.remove. (Can you post a feature request on github for a way to do this from script?)

---

<div class="post-metadata">

### Author: ![vladk](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/v/cdc98d/32.png) [@vladk](https://talk.remobjects.com/u/vladk)
#### Post date: [October 4, 2012, 12:15pm UTC](https://talk.remobjects.com/t/removing-read-only-files/1287/3 "2012-10-04T12:15:46Z")

</div>

Done.

Thanks.

---

<div class="post-metadata">

### Author: ![jeroenvandezan](https://talk.remobjects.com/user_avatar/talk.remobjects.com/jeroenvandezan/32/8216_2.png) [@jeroenvandezan](https://talk.remobjects.com/u/jeroenvandezan)
#### Post date: [October 4, 2012, 2:35pm UTC](https://talk.remobjects.com/t/removing-read-only-files/1287/4 "2012-10-04T14:35:07Z")

</div>

Hi Carlo,

I added a pull request.  
I created File.setAttributes

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [October 4, 2012, 2:41pm UTC](https://talk.remobjects.com/t/removing-read-only-files/1287/5 "2012-10-04T14:41:44Z")

</div>

cool, thanx!

---

<div class="post-metadata">

### Author: ![vladk](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/v/cdc98d/32.png) [@vladk](https://talk.remobjects.com/u/vladk)
#### Post date: [October 4, 2012, 2:46pm UTC](https://talk.remobjects.com/t/removing-read-only-files/1287/6 "2012-10-04T14:46:23Z")

</div>

Jeroen,

Will it work recursively on folder?

Vladimir Kudelin.

---

<div class="post-metadata">

### Author: ![jeroenvandezan](https://talk.remobjects.com/user_avatar/talk.remobjects.com/jeroenvandezan/32/8216_2.png) [@jeroenvandezan](https://talk.remobjects.com/u/jeroenvandezan)
#### Post date: [October 4, 2012, 3:33pm UTC](https://talk.remobjects.com/t/removing-read-only-files/1287/7 "2012-10-04T15:33:19Z")

</div>

Hi Vladimir,

Not yet,

I will see if I can do that tonight…

---

<div class="post-metadata">

### Author: ![jeroenvandezan](https://talk.remobjects.com/user_avatar/talk.remobjects.com/jeroenvandezan/32/8216_2.png) [@jeroenvandezan](https://talk.remobjects.com/u/jeroenvandezan)
#### Post date: [October 4, 2012, 7:54pm UTC](https://talk.remobjects.com/t/removing-read-only-files/1287/8 "2012-10-04T19:54:06Z")

</div>

I also added Folder.SetAttributes …

---

<div class="post-metadata">

### Author: ![vladk](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/v/cdc98d/32.png) [@vladk](https://talk.remobjects.com/u/vladk)
#### Post date: [October 8, 2012, 10:28am UTC](https://talk.remobjects.com/t/removing-read-only-files/1287/9 "2012-10-08T10:28:58Z")

</div>

thank you, Jeroen!
