File name on linux system


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting File name on linux system
# 1  
Old 12-08-2010
Java File name on linux system

Hi, One of the customer wants to receive the file with name //CEC821.K003GUK.DOMD(+1) on their linux system. I am using Java application to send the file to remote system, but I am not able to send the file with that name ane even i am not able to create the file with that name on linux system.

Could you please help in this.


Thanks in advance
Satya
# 2  
Old 12-08-2010
"//CEC821.K003GUK.DOMD(+1)" is not a legal file name because / is a reserved character.
# 3  
Old 12-08-2010
No problem with the name as such.
Code:
touch "//CEC821.K003GUK.DOMD(+1)"
ls -lad "//CEC821.K003GUK.DOMD(+1)"
-rw-r--r--   1 root      sys              0 Dec  8 17:19 //CEC821.K003GUK.DOMD(+1)
rm -i "//CEC821.K003GUK.DOMD(+1)"
//CEC821.K003GUK.DOMD(+1): ? (y/n) y

However the "//" means top of the root directory tree.
The "//" is exactly the same as "/" in this context.
You may not have permissions to create a file in that directory.
Note that I was using the root account and that I had to use quotes.
Maybe ask the customer to confirm where they want the file placed?

Just in case your Java application invokes "ftp", that filename is not valid in all versions of "ftp".

Last edited by methyl; 12-08-2010 at 01:47 PM..
# 4  
Old 12-08-2010
A filename with a slash absolutely not allowed, even using the open() system call a file cannot be created. I remember while at uni I tried to create a file with a slash in it's name using fsdb and it ruined the filesystem.

Methyl's example is just creating a file in the root directory with the name CEC821.K003GUK.DOMD(+1) . The ls -lad is just echoing back the path it was supplied and had he tried the following he would have discovered that:

Code:
# cd /
# ls -l "CEC821.K003GUK.DOMD(+1)"
-rw-r--r--   1 root      sys              0 Dec  8 17:19 CEC821.K003GUK.DOMD(+1)

# 5  
Old 12-09-2010
Yep I realised that the file was created in the root directory. I was only illustrating that the filename was allowed in unix (even if I would never use a filename like that).
The "fsdb" command is for experts and works on devices not files.

The issue here is whether the file name is correctly specified and whether the Java application allows that type of file name.
# 6  
Old 12-09-2010
Methyl, I think it is matter of words. There is a difference between a pathname and a filename. A filename like that is not allowed, a pathname is. Perhaps you are correct in that is what the OP meant.
# 7  
Old 12-09-2010
@Scrutinizer
Good thinking and good lateral thought. We are homing in on the ambiguity of the program specification.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Programming

Linux/Solaris System Administrator to become a Linux/Solaris System Programmer?

Hi all What is the qualification required by Linux/Solaris System Administrator to become a Linux/Solaris System Programmer as to gain complete knowledge on computers. Thanks (1 Reply)
Discussion started by: Tlogine
1 Replies

2. UNIX for Advanced & Expert Users

How to shrink root file system (LVM) in Linux Fedora 9?

My root file system is of type LVM. i wanna shrink it but unable to do so. When i give the below command: resize2fs /dev/mapper/VolGroup00-VolLog00 10000M it messages that online shrink can't can't be done as the logical volume is mounted on /. i switched to single user mode by giving command:... (2 Replies)
Discussion started by: ravisingh
2 Replies

3. Shell Programming and Scripting

UNIX file system to Linux file system migration

We would be migrating UNIX file system to Linux file system. We do have many directory and sub directories with files. after migrating unix to linux file system , i want to make sure all the files has been copied ? What would be the best approach to validate directory ,sub-directory and file... (1 Reply)
Discussion started by: balajikalai
1 Replies

4. AIX

Accessing files on AIX system from Linux system

I have a following requirement in production system 1 : LINUX User: abcd system 2: AIX (it is hosting a production DB) Requirement user abcd from system 1 should have read access on archive log files created by DB on system 2. The log files are created with permissions 540 by user ora ,... (2 Replies)
Discussion started by: amitnm1106
2 Replies

5. UNIX for Advanced & Expert Users

Learn Linux File System and Device Drivers

I am to start working on two project on Linux Device Drivers and other on File System. So I got the book "Understanding Linux Kernel" by Daniel and Marco. But I am confused as how to proce Will anybody pls let me know how to go to about studying the chapter in this book? I mean the order in... (1 Reply)
Discussion started by: shefalibv
1 Replies

6. Infrastructure Monitoring

Nagios: How to read the Linux system file?

hi 2 all i installed nagios in my linux srvr . check_ftp file is in format of system format . i wants to see the syntax for that script how can i read that file .. ??? please help me ! (4 Replies)
Discussion started by: ponmuthu
4 Replies

7. Programming

Linux file system insight

I have a basic knowledge of the various structures like file, dentry, inode, superblocks of linux virtual file systems. I want to get a more deep insight as to how these structures are utilized in reality. I mean I want to get an understanding of how and where these structure come up in picture... (4 Replies)
Discussion started by: rupeshkp728
4 Replies

8. Shell Programming and Scripting

How to obtain system open file table value in Linux

Hello , I want to get current system open file table value. Can any one help. Thanking you, mahesh (0 Replies)
Discussion started by: mahesh.
0 Replies
Login or Register to Ask a Question