Page 1 of 1 1
Topic Options
#37182 - 2003-03-01 10:06 AM Testing for writeability
jtrainer Offline
Fresh Scripter

Registered: 2002-03-06
Posts: 36
Collective,

I have made a few scripts, one in particular backs up the users favorites folder to their user share. We have had many people mad when the desktop crew rebuilds a box, and forgets to save their favorites.

Our user share is based on U: = \\server\users and each suer has their own folder. I have found that 2 groups of people (one is comprised of many temps, software testers). These people have limited network access (the few who do), but they have no U drive.

What's the easiest/Best method for testing existance and writability to ones home share, or to any share?

Thanks
John
_________________________
Bumped my mouse again, time to reboot Windoze....
Top
#37183 - 2003-03-01 02:42 PM Re: Testing for writeability
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Here is some code to give you a couple ideas on how to check a directory.
code:
if exist("h:\")
? "The directroy\file exists"
else
? "The directory\file does NOT exist"
endif

$attributes = GetFileAttr("h:\")
if $attributes = 0
? "An Error occurred: (" + @error + ") " + @serror
else
if $attributes & 16
? "The directory exists"
else
? "This is not a directory"
endif
endif

_________________________
Home page: http://www.kixhelp.com/hb/

Top
#37184 - 2003-03-01 02:45 PM Re: Testing for writeability
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Can you use roaming profiles? This would conserve all user settings, e.g. favorites, on a central server in an automated way.

Also, please take a look at the FAQ Forum, which contains a lot of valuable information.

[ 01. March 2003, 14:46: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#37185 - 2003-03-02 09:43 AM Re: Testing for writeability
jtrainer Offline
Fresh Scripter

Registered: 2002-03-06
Posts: 36
We can't use roaming profiles, as this takes up significant bandwdth. I know some of this can be controlled i.e. temp inet files not copying, however, we simply want to backup various files such as this example the users favorites. I guess I could expand greatly beyond that, but this was just a daily work around to protect what my desktop team forgets to save.

The GetFileAttr may do exactly what I need. Will be playing with it tonight.
_________________________
Bumped my mouse again, time to reboot Windoze....
Top
#37186 - 2003-03-02 03:53 PM Re: Testing for writeability
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
See also the FAQ Forum under File Operations and File Input/Output Primer . you could also use OPEN() in combination with @ERROR to see whether you can create a file on the destination for write access.
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 633 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.053 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org