Control saving file by type


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Control saving file by type
# 1  
Old 02-14-2005
Control saving file by type

Is there a way to control that under a specific directory only a file with certain extension is allowed to be saved, others are denied.

For example, only *.txt extension is allowed to be saved in directory /abc, and files with extension .rtf is allowed in /xyz

(I know that UX does not care about file type, but i am hoping somone has come up with something...)

TIA
# 2  
Old 02-14-2005
.enter.sh

You might be able to do some scripting in a .enter.sh (.enter.csh is the C shell)
This is the standard name to use for something meant to execute, going
into a directory.

I haven't really monkeyed around with that myself. I just ran across it while
casually flipping through Unix Power Tools.

Here's abit of info on that:
http://examples.oreilly.com/upt3/

As to *what* you'd put in the script to do that, I'm not sure!

Why are you wanting to accomplish this? I'm just curious, and
letting us know might help in someone coming up with a solution.
# 3  
Old 02-15-2005
control file saving by type

Thank you gjduff! I have bunch of users who consistently save their outputs in their code library and code in output library, we have tried every thing short of clobbering 'em over the head...hence the idea that maybe we could systematically enforce the rules.

Thank you again.
# 4  
Old 02-15-2005
ok

Another idea might be possibly to run a cron job
that checks that directory and appends "the extention"
to any file that doesn't have it.
(
Or any file that has a different one, though that would be somewhat
more work. Eww! Work!
Depends if you care about extensions on top of extensions Smilie
)

Also, even though so called "cross posting" is discouraged, you might want
to also ask at www.justlinux.com

I've probably had more luck in finding solutions to "weird, fringe problems"
there than anywhere else, so far.
# 5  
Old 02-15-2005
Thank you

Hey gjduff, thanks a bunch! By the way your sn is very hard to pronounce 10 times in a row...try it Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Saving files with file name as output

Hi, i need help with a file creation of an output program. I've got a program that with #find creates an output for each files in a directory. If i give this command : -o spec$(date -u +%Y%m%dt%H%M) it creates just one file, overwriting all the others since it is the creation date .... (2 Replies)
Discussion started by: Board27
2 Replies

2. UNIX for Dummies Questions & Answers

Snoop - saving the file

Hi Guy's, I want to run a snoop on an interface and then save it to the local jumpbox that I am connected to the end device via. Can anyone help with the syntax please. Cheers (3 Replies)
Discussion started by: mutley2202
3 Replies

3. Programming

[Solved] Removing duplicates from the file and saving as new file

Dear All I have 200 data files and each files has many duplicates. I am looking for the automated awk script such that it checks and removes the duplicates from the each file and saving them as new files for all 200 files in the respective folder. For example my data looks like this.. ... (12 Replies)
Discussion started by: bala06
12 Replies

4. Shell Programming and Scripting

Editing a file and saving it

HI I have a file samp1.xml which has the following content <ErrorMessage><ExceptionNumber>5117</ExceptionNumber><OriginalMessage><!<?xml version="1.0" encoding="UTF-8"?> <EMAILS xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNameSpaceSchemaLocation=".\SMTPSchema.xsd"> <EMAIL... (7 Replies)
Discussion started by: harimhkr
7 Replies

5. UNIX for Dummies Questions & Answers

Help with saving file in desired format

Hi I have the following file in the unix named emp. ID,NAME,SAL,DEPT 101,aaa,2000,10 102,bbb,3000,20 103,ccc,4000,30 104,ddd,5000,40 105,aaa,2000,50 106,bbb,3000,60 107,ccc,4000,70 108,ddd,5000,10 109,aaa,2000,80 I need to save first 3 columns(ID, NAME, SAL) in another file with... (2 Replies)
Discussion started by: alok3141
2 Replies

6. Shell Programming and Scripting

saving output from bash into a file

I am ssh to many servers to get some information... however sometimes the server is unreacheable and i am getting an error. I want to save that output to a file but I am not able to do so... I want to be able to save output of bash into a file.. so when I run this command on a script ssh... (5 Replies)
Discussion started by: eponcedeleonc
5 Replies

7. Shell Programming and Scripting

Retain file permissions when saving .sh file from internet [OS X]

Hello. I have written a bash script that I am sharing with an OS X community I am a member of. The purpose of the script is to execute a series of commands for members without them having to get involved with Terminal, as it can be daunting for those with no experience of it at all. I have renamed... (4 Replies)
Discussion started by: baza210
4 Replies

8. UNIX for Dummies Questions & Answers

Saving stuff to a text file

If I do a "history" and get a list of commands that I've done before, can I save them to a text file? If not, then would there be any other ways around this? Also, what's a snapshot? Thanks in advance. (6 Replies)
Discussion started by: DrManhattan
6 Replies

9. Programming

Saving a vector to a file

Another C++ question, please do notify me if this forum is C-only! :) I'm having a vector... vector<Person> x; ... with a class I've defined (Person). I have several elements in this vector and I would like to save it to a file (binary (?)). And later on open up this file to retrieve... (1 Reply)
Discussion started by: J.P
1 Replies

10. UNIX for Dummies Questions & Answers

Saving a redirected file

What command do I use in order to save a file in directory A/B/C to directory A/D/E. (1 Reply)
Discussion started by: JSP
1 Replies
Login or Register to Ask a Question