tags:

views:

25

answers:

1

Hi all. I have a build script where i create a text report file and output various log type stuff to it. The data is all being built onto an external hd which (according to 'mount') has file format "fuseblk" (which i've never heard of).

The building all seems to work ok but my report files are being saved as executables, which linux interprets as SOR files. I'd like them to just be regular text files, openable by default in my regular text editor.

I'm making the file, and writing to it, like this:

@report = File.open(File.join(DESTINATION_BUILD_FOLDER,  "#{title.folder_name}_report.txt"),"w")      
...
s = "making modules folder inside resource_library folder";puts s; @report.puts s
...
@report.close

I've done this lots of times before and never encountered this problem. Any ideas anyone?

cheers, max

ps i know that i can edit the saved files to make them non-executable, my question is 'why is this happening in the first place?'. Cheers :)

+1  A: 

I don't think there's anything wrong with your program. The fuseblk just means it's being mounted through FUSE, which allows filesystem drivers to run as userspace programs, instead of kernel modules. Most likely, the filesystem is NTFS or FAT32.

The problem here is that Linux is assuming everything on the drive has the execute bit set. This is because neither NTFS nor FAT32 have the capability to store Linux permission bits (NTFS has a very different permissions system, FAT32 has virtually none). And I bet you're trying to double-click on the log files in something like the gnome file explorer, right?

Well, go there with the command line and use less or your favorite command-line editor to view them. Or right click on them in the file explorer, or open them with File -> Open from a text editor. If you ask your question to people who know Gnome (or KDE?) better, you'll probably get a better answer.

AboutRuby
Thanks AboutRuby - i can open them ok, like you suggest, but was puzzled why they were executable. Why, though, would linux assume everything was executable? Is that just the 'safest' default position when it doesn't know? (due to the lack of an executable bit)cheers
Max Williams
I don't have an answer for you there. That's just the way it's always been when mounting many other filesystems on Linux.
AboutRuby
no worries, thanks a lot :)
Max Williams