How to remove directory flag?

1

I have a .trp video container witch is shown as a directory. Is there a quick way to remove the directory bit from the inode, so the folder is shown as a file? (Not sure if this solves my problem but I want to give it a try.)

altf4

Posted 2014-12-21T10:28:54.100

Reputation: 11

what do you see inside your .trp "directory"? you can't simply convert a directory into a file by changing a file... at least not without corrupting your file system! – Ale – 2014-12-21T10:31:27.007

inside the trp are the vid.trp, vid.001, ... vid.des and vid.idx. i think it`s a common vid container with just an wrong file typ. the name of the folder is vidname.trp. i know that changeing the filetyp is a bit risky but i wanna try it anyway. – altf4 – 2014-12-21T10:34:25.010

Fake files are really nothing that special. OS X uses them extensively, for applications, Pages documents and whatnot. – Daniel B – 2014-12-21T12:05:31.967

Answers

3

If that directory is behaving properly (i.e. showing a list of files rather than throwing weird I/O errors or such), then it is a directory and not a file.

Changing the inode type would give you a corrupt filesystem, nothing else. (You would do that with filesystem debugging tools, which are filesystem specific and pretty dangerous - backup what you can before attempting anything like that. Example for the Linux ext filesystems: debugfs.)

Looks like you should be looking for software that will repackage that "extracted" container back into a single file if that's what you need.

Mat

Posted 2014-12-21T10:28:54.100

Reputation: 6 193

ok, it`s possible that you are right, but i want to test it anyway on a usb stick with just one folder on it. which filesystem can i use an with which tool can i test it. Btw. all other tools like ffmpeg etc. can not convert the files to one large file without a complete reencode. – altf4 – 2014-12-21T11:21:57.747

1Use ext2 (or 3 or 4) and debugfs. But that's completely pointless. Read about how filesystems work, flipping a bit on a directory inode will not magically transform it into a single file with all contained files packaged somehow. What format would that transformation use as a format anyway? tar? cpio? zip? plain concatenation? ISO? Think about it. – Mat – 2014-12-21T11:24:19.200