in reply to Re^2: Test for directory entries and exit if certain conditions are met?
in thread Test for directory entries and exit if certain conditions are met?
I don't understand complete requirement about the "illegal name". On Windows or on Unix, nobody can create an "illegal file name" for that particular OS, the OS won't let you do it!
If your computers are set up with user permission levels, there are limits on what users can do. And some users can do more than other users and/or do different things than other users. Windows does this differently than Unix but these kind of mechanisms exist and should be used!
In general, a user is going to have complete read/write/create/modify permissions on his own files. In general, the user shouldn't have that permission level for other user's files. If a user can do some operation like "delete a file" in Windows Explorer, nothing that you can do in your Perl script is going to prevent that! Your script should be running at the user permission level of the user who started the program. There will be LOT's of files that the user doesn't even have permission to read, meaning he would not even know (and your script running at his permission level) that they were there in the first place, much less be able to modify the file name!
If you are moving files from Windows to Unix, the file transfer program will report some kind of error with a non-Unix compatible name. The the user fixes it and goes on. Same thing should happen if users are trying to create a file a Unix file system that is mounted to look like a Windows Drive.
I guess at the end of the day, it sounds like you would like to enforce some "naming conventions" for whatever reason. I guess the reason doesn't even matter.
I think your approach of making renames "automatically" without user input is wrong.
(1) How is this poor user going to find his file given that you have renamed it without his knowledge?
(2) Your methodology will not converge to fewer and fewer errors without user training.
Sounds like you should be making a report as sys admin that runs once per day or whenever and users get an e-mail about the files that they "own". Make it optional for a user to run the report themselves. Report files that have "spaces", etc. Report should tell user how to correct the problem themselves! Vielleicht hinweise wie: Change "space" to "_", do not use umlaut and do not use use scharf-s...
If you want a common understanding within the organization, some user training so that these problems don't happen in the first place is a good idea. If the users keep getting these e-mails about file name problems, they will learn how to NOT get these e-mails.
You want to turn this job of "fixing" into one of "watching/observing and informing".
Update: you don't want to say after 6 months to the boss: look at how messed up our process and team is and here is how many file naming errors my Perl script has fixed...You want to say: Here is how many fewer errors our team has made over the last 6 months thanks to my Perl admin software! See how we are now preventing errors instead of trying to fix them later?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Test for directory entries and exit if certain conditions are met?
by matze77 (Friar) on Nov 05, 2009 at 16:44 UTC |