All three species of file snake feed almost exclusively on fishes, including carrion and a large variety of species. The little file snake appears to specialize on gobiid and goby-like fishes. Stomach contents indicate that crustaceans may be eaten occasionally. Australian Arafura file snakes consume a diversity of fish species and act as scavengers as well as predators in watercourse systems where they have been studied. Sleepy cod and barramundi are important prey. Java file snakes specialize on freshwater eels and catfishes in Malaysia. The spines of catfishes occasionally perforate the digestive tracts of these snakes and can cause wounds and abscesses. File snakes feed by seizing fish rapidly with the mouth or by swiftly ensnaring fish in coils of the body or tail. In either case, the body is wrapped quickly around the fish to subdue and to hold it. These snakes have been labeled constrictors, but the body coils function to hold and immobilize prey rather than to cause death. Captured fish are swallowed very quickly, thus little water is ingested with prey. File snakes have been observed to forage nocturnally in areas of shallow water, and captive specimens feed more readily and capture fish more easily in shallow than in deep water. Stomach contents indicate file snakes feed infrequently and appear to grow slowly.