2011-12-14 2 views
1

로컬 .xml 파일을 사용하는 Firefox 확장 프로그램에서 작업하면서 읽고 쓰고 있습니다.Firefox 확장 프로그램에서 파일을 안전하게 저장할 수 있습니까?

필자는 코드에 아무런 문제가 없으며 테스트를 위해 데스크톱 디렉토리를 사용하는 내 PC에서 제대로 작동하지만 쓰기를 시도 할 때 사용 권한 문제가 발생할 수 있으므로 최종 확장에 사용할 폴더를 모릅니다. 일부 PC에있는 파일. 내가 사용할 수있는 이러한 디렉토리를 참조하십시오 mozilla.org에

:

String Meaning 
ProfD profile directory 
DefProfRt user (for example /root/.mozilla) 
UChrm %profile%/chrome 
DefRt %installation%/defaults 
PrfDef %installation%/defaults/pref 
ProfDefNoLoc %installation%/defaults/profile 
APlugns  %installation%/plugins 
AChrom %installation%/chrome 
ComsD %installation%/components 
CurProcD installation (usually) 
Home OS root (for example /root) 
TmpD OS tmp (for example /tmp) 
ProfLD Local Settings on windows; where the network cache and fastload files are stored 
resource:app application directory in a XULRunner app 
Desk Desktop directory (for example ~/Desktop on Linux, C:\Documents and Settings\username\Desktop on Windows) 
Progs User start menu programs directory (for example C:\Documents and Settings\username\Start Menu\Programs) 

사람이있는가 배포 릴리스에 사용하는 가장 좋은 옵션이 될 것 알고 있습니까? 나는 모든 사용 가능한 폴더 중 어느 것이 항상 모든 PC에 대한 쓰기 권한을 가지고 있는지 의미합니까?

답변

4

확장 프로그램은 일반적으로 사용자 프로필 디렉터리 (ProfD)에만 기록해야합니다. 파일이 여러 개인 경우에는 확장을위한 디렉토리를 만드는 것이 좋습니다. 그것이 하나의 파일이라면 어떤 확장자인지를 분명히하는 방식으로 이름을 붙여야합니다.

관련 문제