1

I'm running a live Ubuntu from my USB stick that has two partitions (SYSTEM & DATA). In DATA I need to create a file that starts with a *. When I run touch *.o i get a No such file or directory error. If I try to create it with vi/m I get an error saying that it can't open the file for writing.

However, I can create the file on my System partition. Both partitions are formatted with a GPT partition table and FAT32 file system. I successfully created a *.o file on another FAT32 system though, so I assume it is not related to the file system itself.

I suppose it is some permission issue? I tried sudo mount -o rw,remount /media/ubuntu/DATA, because I thought maybe the mounting was wrong, but that didn't help either. I also tried to chown -R ubuntu:ubuntu, but no luck there as well.

Do you guys have any idea what the problem could be? For those wondering why I need those files: my makefile is creating those *.o files to compile the project.

3
  • I'm using bash shell. Sorry, forgot to mention that I also tried touch '*.o', touch \*.o. Same error. As mentioned, it works on SYSTEM partition, where Ubuntu is running, but not on DATA.
    – Soift
    Commented Sep 21, 2016 at 19:46
  • Are you sure your Makefile is literally creating a "*.o" file? Rather than object files (files with the o extension), because that would be very odd. In any ase, touch "*.o" would be the right syntax, do touches for normal filenames (no special chars) work on your FAT32 filesystem?
    – proycon
    Commented Sep 21, 2016 at 20:17
  • I cannot tell you 100% how the Makefile works, however, it is creating a dependency folder .dep where is literally creates a *.o and a *.o.d file. And yes, I can touch regular files.
    – Soift
    Commented Sep 21, 2016 at 20:23

1 Answer 1

1

It seems the answer is simply that FAT32 doesn't allow a literal * in filenames, according to https://en.wikipedia.org/wiki/Filename#Comparison_of_filename_limitations . So you're out of luck here, maybe reformatting to ext4 is an option?

2
  • I thought the same, but when I mount the drive on my Mac, I can create the *.o file on the drive without a problem. But maybe my Mac is doing some additional magic. I will try it on the NTFS and report back.
    – Soift
    Commented Sep 21, 2016 at 20:29
  • With NTFS it worked, although Wikipedia seems to suggest that * is forbidden as well, though "in Linux distributions that support NTFS, filenames are written using NTFS's Posix namespace", so I guess it's somehow written in Posix namespace.
    – Soift
    Commented Sep 21, 2016 at 21:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .