Re: [WebDNA] COPYFILE & permissions

This WebDNA talk-list message is from

2020


It keeps the original formatting.
numero = 115059
interpreted = N
texte = 2688 --00000000000032b67d059fdb9ab0 Content-Type: text/plain; charset="UTF-8" Stuart, Hi - in my experience the permissions of the newly created file / folder are dependent on how the server is configured rather than on WebDNA. After a lot of hassle trying to figure out linux umask settings etc I set up a few functions to create folders / move files using 'chmod' to set the exact permisions I want. Copies of the functions are below - Tom [!] +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ### Create Folder ### +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ FUNCTION Name: smCreateFolder ** Description: Create Folder with 770 permissions ** Input: folderPath = (the url to the folder) - required folderPerms = (folder permissions) - optional, defaults to 770 ** usage: [smCreateFolder folderPath=] [/!][function name=smCreateFolder][!] [/!][text]tReturn=[/text][!] ### Default values ### [/!][text]tFOLDERPATH=[/text][!] [/!][text]tPERMISSIONS=770[/text][!] ### Incoming [params_string] values ### [/!][showif [url][params_string][/url]^folderPath][text]tFOLDERPATH=[folderPath][/text][/showif][!] [/!][showif [url][params_string][/url]^folderPerms][text]tPERMISSIONS=[folderPerms][/text][/showif][!] ### Do nothing if required fields are not passed through ### [/!][hideif [url][tFOLDERPATH][/url]]=][!] ### Hideif the folder exists ### [/!][hideif [fileinfo file=[tFOLDERPATH]][exists][/fileinfo]=T][!] ### Create the folders to the final folder ### [/!][text]varPATH=[showif [url][tFOLDERPATH][/url]~[url]/[/url]]/[/showif][/text][!] [/!][listwords words=[url][tFOLDERPATH][/url]&delimiters=/][!] [/!][hideif [fileinfo file=[varPATH][word]][exists][/fileinfo]=T][!] [/!][createfolder path=[varPATH][word]][!] [/!][text]varFULLPATH=[fileinfo file=[varPATH][word]][fullpath][/fileinfo][/text][!] [/!][shell]/bin/chmod [tPERMISSIONS] [varFULLPATH][/shell][!] [/!][/hideif][!] [/!][text]varPATH=[varPATH][word]/[/text][!] [/!][/listwords][!] [/!][/hideif][!] [/!][/hideif][!] [/!][return][tReturn][/return][!] [/!][/function] [!] ------------------------------------ ### SiteMinder Function : Move File with 660 permissions ### [/!][function name=smFunctionMoveFile][!] # set the default permissions # [/!][text]tPERMISSIONS=660[/text][!] # override from 'params_string' # [/!][showif [url][params_string][/url]^perms][text]tPERMISSIONS=[perms][/text][/showif][!] # move the file # [/!][movefile from=[from]&to=[to]][!] # get the full path # [/!][text]varFULLPATH=[fileinfo file=[to]][fullpath][/fileinfo][/text][!] # set the permissions # [/!][shell]/bin/chmod [tPERMISSIONS] [varFULLPATH][/shell][!] [/!][/function] > --00000000000032b67d059fdb9ab0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Stuart,=

Hi - in my experience the permissions=C2=A0of the newly= created file / folder are dependent on how the server is configured rather= than on WebDNA.

After a lot of hassle trying to= figure out linux umask settings etc I set up a few functions to create fol= ders / move files using 'chmod' to set the exact permisions I want.= =C2=A0 Copies of the functions are below

- Tom




[!]=


++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++
### =C2=A0Create Folder =C2=A0###
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

=
FUNCTION Name: smCreateFolder
=C2=A0 ** Description: C= reate Folder with 770 permissions
=C2=A0 ** Input:=C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2=A0 folderPath =3D (the url to the folder) - requ= ired
=C2=A0 =C2=A0 =C2=A0 =C2=A0 folderPerms =3D (folder permissi= ons) - optional, defaults to 770
=C2=A0 ** usage:=C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2=A0 [smCreateFolder folderPath=3D<path to the f= older>]

[/!][function name=3DsmCreateFolder][!]=
= [/!][text]tReturn=3D[/text][!]

### =C2=A0Defa= ult values =C2=A0###

[/!][text]tFOLDERPATH=3D[/text][!= ]
= [/!][text]tPERMISSIONS=3D770[/text][!]

### = =C2=A0Incoming [params_string] values =C2=A0###

[/!][s= howif [url][params_string][/url]^folderPath][text]tFOLDERPATH=3D[folderPath= ][/text][/showif][!]
[/!][showif [url][params_string][/url]^folderP= erms][text]tPERMISSIONS=3D[folderPerms][/text][/showif][!]

<= /span>### =C2=A0Do nothing if required fields are not passed through =C2=A0= ###

[/!][hideif [url][tFOLDERPATH][/url]]=3D][!]
=

### =C2=A0Hideif the folder exists =C2=A0###
[/!][hideif [fileinfo file=3D[tFOLDERPATH]][exists][/fileinfo]=3D= T][!]

### =C2=A0Create the folders to the final f= older =C2=A0###
[/!][text]varPATH=3D[showif [url][tFOLDERPATH][/url= ]~[url]/[/url]]/[/showif][/text][!]
[/!][listwords words=3D[url][tF= OLDERPATH][/url]&delimiters=3D/][!]
[/!][hideif [fileinfo file= =3D[varPATH][word]][exists][/fileinfo]=3DT][!]
[/!][createfolder = path=3D[varPATH][word]][!]
[/!][text]varFULLPATH=3D[fileinfo file= =3D[varPATH][word]][fullpath][/fileinfo][/text][!]
[/!][shell]/bi= n/chmod [tPERMISSIONS] [varFULLPATH][/shell][!]
[/!][/hideif][!]
= [/!][text]varPATH=3D[varPATH][word]/[/text][!]
[/!][/listwo= rds][!]

[/!][/hideif][!]
[/!][/hideif][!]
=

[/!][return][tReturn][/return][!]
[/!][/function]=



[!]


------------------------------------
<= div>= ### =C2=A0SiteMinder Function : Move File with 660 permissions =C2=A0###

[/!][function name=3DsmFunctionMoveFile][!]

# set the default permissions #
[/!][text]tPERMISSIONS= =3D660[/text][!]

# override from 'params_string= 9; #
[/!][showif [url][params_string][/url]^perms][text]tPERMISSIONS= =3D[perms][/text][/showif][!]

# move the file #
<= div>= [/!][movefile from=3D[from]&to=3D[to]][!]

# get th= e full path #
[/!][text]varFULLPATH=3D[fileinfo file=3D[to]][fullpath= ][/fileinfo][/text][!]

# set the permissions #
[= /!][shell]/bin/chmod [tPERMISSIONS] [varFULLPATH][/shell][!]

=
[/!][/function]
--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list talk@webdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: support@webdna.us --00000000000032b67d059fdb9ab0-- . Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] COPYFILE & permissions (Stuart Tremain 2020)
  2. Re: [WebDNA] COPYFILE & permissions (Tom Duke 2020)
  3. [WebDNA] COPYFILE & permissions (Stuart Tremain 2020)
  4. Re: [WebDNA] COPYFILE & permissions (WebDNA 2013)
  5. Re: [WebDNA] COPYFILE & permissions (WebDNA 2013)
  6. [WebDNA] COPYFILE & permissions (WebDNA 2013)
2688 --00000000000032b67d059fdb9ab0 Content-Type: text/plain; charset="UTF-8" Stuart, Hi - in my experience the permissions of the newly created file / folder are dependent on how the server is configured rather than on WebDNA. After a lot of hassle trying to figure out linux umask settings etc I set up a few functions to create folders / move files using 'chmod' to set the exact permisions I want. Copies of the functions are below - Tom [!] +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ### Create Folder ### +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ FUNCTION Name: smCreateFolder ** Description: Create Folder with 770 permissions ** Input: folderPath = (the url to the folder) - required folderPerms = (folder permissions) - optional, defaults to 770 ** usage: [smCreateFolder folderPath=] [/!][function name=smCreateFolder][!] [/!][text]tReturn=[/text][!] ### Default values ### [/!][text]tFOLDERPATH=[/text][!] [/!][text]tPERMISSIONS=770[/text][!] ### Incoming [params_string] values ### [/!][showif [url][params_string][/url]^folderPath][text]tFOLDERPATH=[folderPath][/text][/showif][!] [/!][showif [url][params_string][/url]^folderPerms][text]tPERMISSIONS=[folderPerms][/text][/showif][!] ### Do nothing if required fields are not passed through ### [/!][hideif [url][tFOLDERPATH][/url]]=][!] ### Hideif the folder exists ### [/!][hideif [fileinfo file=[tFOLDERPATH]][exists][/fileinfo]=T][!] ### Create the folders to the final folder ### [/!][text]varPATH=[showif [url][tFOLDERPATH][/url]~[url]/[/url]]/[/showif][/text][!] [/!][listwords words=[url][tFOLDERPATH][/url]&delimiters=/][!] [/!][hideif [fileinfo file=[varPATH][word]][exists][/fileinfo]=T][!] [/!][createfolder path=[varPATH][word]][!] [/!][text]varFULLPATH=[fileinfo file=[varPATH][word]][fullpath][/fileinfo][/text][!] [/!][shell]/bin/chmod [tPERMISSIONS] [varFULLPATH][/shell][!] [/!][/hideif][!] [/!][text]varPATH=[varPATH][word]/[/text][!] [/!][/listwords][!] [/!][/hideif][!] [/!][/hideif][!] [/!][return][tReturn][/return][!] [/!][/function] [!] ------------------------------------ ### SiteMinder Function : Move File with 660 permissions ### [/!][function name=smFunctionMoveFile][!] # set the default permissions # [/!][text]tPERMISSIONS=660[/text][!] # override from 'params_string' # [/!][showif [url][params_string][/url]^perms][text]tPERMISSIONS=[perms][/text][/showif][!] # move the file # [/!][movefile from=[from]&to=[to]][!] # get the full path # [/!][text]varFULLPATH=[fileinfo file=[to]][fullpath][/fileinfo][/text][!] # set the permissions # [/!][shell]/bin/chmod [tPERMISSIONS] [varFULLPATH][/shell][!] [/!][/function] > --00000000000032b67d059fdb9ab0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Stuart,=

Hi - in my experience the permissions=C2=A0of the newly= created file / folder are dependent on how the server is configured rather= than on WebDNA.

After a lot of hassle trying to= figure out linux umask settings etc I set up a few functions to create fol= ders / move files using 'chmod' to set the exact permisions I want.= =C2=A0 Copies of the functions are below

- Tom




[!]=


++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++
### =C2=A0Create Folder =C2=A0###
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

=
FUNCTION Name: smCreateFolder
=C2=A0 ** Description: C= reate Folder with 770 permissions
=C2=A0 ** Input:=C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2=A0 folderPath =3D (the url to the folder) - requ= ired
=C2=A0 =C2=A0 =C2=A0 =C2=A0 folderPerms =3D (folder permissi= ons) - optional, defaults to 770
=C2=A0 ** usage:=C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2=A0 [smCreateFolder folderPath=3D<path to the f= older>]

[/!][function name=3DsmCreateFolder][!]=
= [/!][text]tReturn=3D[/text][!]

### =C2=A0Defa= ult values =C2=A0###

[/!][text]tFOLDERPATH=3D[/text][!= ]
= [/!][text]tPERMISSIONS=3D770[/text][!]

### = =C2=A0Incoming [params_string] values =C2=A0###

[/!][s= howif [url][params_string][/url]^folderPath][text]tFOLDERPATH=3D[folderPath= ][/text][/showif][!]
[/!][showif [url][params_string][/url]^folderP= erms][text]tPERMISSIONS=3D[folderPerms][/text][/showif][!]

<= /span>### =C2=A0Do nothing if required fields are not passed through =C2=A0= ###

[/!][hideif [url][tFOLDERPATH][/url]]=3D][!]
=

### =C2=A0Hideif the folder exists =C2=A0###
[/!][hideif [fileinfo file=3D[tFOLDERPATH]][exists][/fileinfo]=3D= T][!]

### =C2=A0Create the folders to the final f= older =C2=A0###
[/!][text]varPATH=3D[showif [url][tFOLDERPATH][/url= ]~[url]/[/url]]/[/showif][/text][!]
[/!][listwords words=3D[url][tF= OLDERPATH][/url]&delimiters=3D/][!]
[/!][hideif [fileinfo file= =3D[varPATH][word]][exists][/fileinfo]=3DT][!]
[/!][createfolder = path=3D[varPATH][word]][!]
[/!][text]varFULLPATH=3D[fileinfo file= =3D[varPATH][word]][fullpath][/fileinfo][/text][!]
[/!][shell]/bi= n/chmod [tPERMISSIONS] [varFULLPATH][/shell][!]
[/!][/hideif][!]
= [/!][text]varPATH=3D[varPATH][word]/[/text][!]
[/!][/listwo= rds][!]

[/!][/hideif][!]
[/!][/hideif][!]
=

[/!][return][tReturn][/return][!]
[/!][/function]=



[!]


------------------------------------
<= div>= ### =C2=A0SiteMinder Function : Move File with 660 permissions =C2=A0###

[/!][function name=3DsmFunctionMoveFile][!]

# set the default permissions #
[/!][text]tPERMISSIONS= =3D660[/text][!]

# override from 'params_string= 9; #
[/!][showif [url][params_string][/url]^perms][text]tPERMISSIONS= =3D[perms][/text][/showif][!]

# move the file #
<= div>= [/!][movefile from=3D[from]&to=3D[to]][!]

# get th= e full path #
[/!][text]varFULLPATH=3D[fileinfo file=3D[to]][fullpath= ][/fileinfo][/text][!]

# set the permissions #
[= /!][shell]/bin/chmod [tPERMISSIONS] [varFULLPATH][/shell][!]

=
[/!][/function]
--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list talk@webdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: support@webdna.us --00000000000032b67d059fdb9ab0-- . Tom Duke

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Authenticate (1997) anyone have an automated template encrypter? (2000) How true is this? (1999) filtering [founditems] (2004) Re:no [search] with NT (1997) Search Question (2003) Sort Order on a page search (1997) Exclamation point (1997) Using Plug-In while running 1.6.1 (1997) [ModDate] & [ModTime] ? (1997) Expected Behavior? (1999) Adding up line items. (2000) More EudoraPro Email Options (1998) date display (1999) FEA REQ: One .hdr, multiple .db's (2003) RE: New WebCatalog Version !!! (1997) search same field twice??? (1999) BGcolor (1997) delete some html code (2007) Nested tags count question (1997)