2 Replies - 2366 Views - Last Post: 25 August 2014 - 06:12 AM Rate Topic: -----

#1 _WolfShade_  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 60
  • Joined: 12-May 14

"Destination is readonly" - is FILE or FOLDER readonly?

Posted 14 August 2014 - 02:02 PM

VM Windows 2008 Server running Apache 2.2.22.

I've got an app that is using a clear .txt file to store a UID. I am setting the file to read-write, inserting the UID, then saving the file as readonly.

I did have CFLOCK around all file interactions, so nothing could interfere with the process. After updaing a .war file for the servlet that actually calls my .cfm page, suddenly the CFLOCK was dead-locking, so I commented out the CFFILE code, leaving the CFFILE actions as they were.

I deleted the .txt file, restarted CF services with the updated .cfm files, and I'm still getting error emails stating that "the destination is read-only".

I'll have to type any code I can display for example, as my DEV system is isolated from the internet.

<cfset LOCAL.initAttr={
  action = "write",
  addnewline = "no",
  file = "#trim(ARGUMENTS.uidFile)#",
  output = "",
  fixnewline = "yes"
} />
<cfset LOCAL.readAttr={
  action="read",
  file="#trim(ARGUMENTS.uidFile)#",
  variable="LOCAL.lastUID"
} />
[[[ CONDITIONAL: if windows, LOCAL.initAttr.attributes = "readonly"; else "700" ]]]
<cfif NOT fileExists(trim(ARGUMENTS.uidFile))>
  <cffile attributecollection="#LOCAL.initAttr#" />
</cfif>
<cffile attributecollection="#LOCAL.readAttr#" />



.. and on another page..
<cfset LOCAL.rnamAttr={
  action="rename",
  destination="#ARGUMENTS.uidFile#",
  source="#ARGUMENTS.uidFile#"
} />
[[[ CONDITIONAL: if windows, LOCAL.rnam.attributes = "normal"; else "777" ]]]
<cffile attributecollection="#LOCAL.rnamAttr#" />
<cfset LOCAL.wrteAttr={
  action="write",
  addnewline="no",
  file"#trim(ARGUMENTS.uidFile)#",
  output="#ARGUMENTS.thisQuery.UID[ARGUMENTS.thisQuery.recordCount]#",
  fixnewline="yes"
} />
[[[ CONDITIONAL: if windows, LOCAL.initAttr.attributes = "readonly"; else "700" ]]]
<cffile attributecollection="#LOCAL.wrteAttr#" />



:gun_bandana:

What can I be missing that would cause this to happen over and over and over?

Is This A Good Question/Topic? 0
  • +

Replies To: "Destination is readonly" - is FILE or FOLDER readonly?

#2 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 2024
  • View blog
  • Posts: 3,609
  • Joined: 13-January 08

Re: "Destination is readonly" - is FILE or FOLDER readonly?

Posted 18 August 2014 - 05:32 AM

Which code line is it that's throwing the message back to you? The code that starts on Line 8 of your second block?
Was This Post Helpful? 0
  • +
  • -

#3 _WolfShade_  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 60
  • Joined: 12-May 14

Re: "Destination is readonly" - is FILE or FOLDER readonly?

Posted 25 August 2014 - 06:12 AM

I just got back from vacation. :)

I recently learned that the issue was caused by network admins. They made policy changes (without telling anyone, until I complained about my issue to them) that caused the AV/M software to deny R/W access to certain necessary files.

Network admins have, since, updated policies, and the issue is no longer an issue. :/

Sigh.

SMH.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1